Search Results for

    Show / Hide Table of Contents

    Class PropertiesComparerConfiguration<T>

    Generic version of PropertiesComparerConfiguration to allow specifiying properties using expression syntax instead of strings.

    Inheritance
    object
    PropertiesComparerConfiguration
    PropertiesComparerConfiguration<T>
    Inherited Members
    PropertiesComparerConfiguration.SetTolerance(object)
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework.Constraints
    Assembly: nunit.framework.dll
    Syntax
    public class PropertiesComparerConfiguration<T> : PropertiesComparerConfiguration
    Type Parameters
    Name Description
    T

    Constructors

    View Source

    PropertiesComparerConfiguration()

    Declaration
    public PropertiesComparerConfiguration()

    Methods

    View Source

    AllowDifferentTypes()

    Set the NUnit.Framework.Constraints.PropertiesComparerConfiguration.AllowComparingDifferentTypes property.

    Declaration
    public PropertiesComparerConfiguration<T> AllowDifferentTypes()
    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    View Source

    CompareOnlyCommonProperties()

    Set the NUnit.Framework.Constraints.PropertiesComparerConfiguration.OnlyCompareCommonProperties property.

    Declaration
    public PropertiesComparerConfiguration<T> CompareOnlyCommonProperties()
    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    Remarks

    Implies AllowDifferentTypes()

    View Source

    Excluding(params Expression<Func<T, object?>>[])

    Set the NUnit.Framework.Constraints.PropertiesComparerConfiguration.PropertyNamesToExclude property.

    Declaration
    public PropertiesComparerConfiguration<T> Excluding(params Expression<Func<T, object?>>[] properties)
    Parameters
    Type Name Description
    Expression<Func<T, object>>[] properties

    List of properties to use for comparison.

    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    View Source

    Excluding<TFrom>(params Expression<Func<TFrom, object?>>[])

    Set the NUnit.Framework.Constraints.PropertiesComparerConfiguration.PropertyNamesToExclude property.

    Declaration
    public PropertiesComparerConfiguration<T> Excluding<TFrom>(params Expression<Func<TFrom, object?>>[] properties)
    Parameters
    Type Name Description
    Expression<Func<TFrom, object>>[] properties

    List of properties to use for comparison.

    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    Type Parameters
    Name Description
    TFrom
    View Source

    Map<TTo>(Expression<Func<T, object?>>, Expression<Func<TTo, object?>>)

    Updates the NUnit.Framework.Constraints.PropertiesComparerConfiguration.PropertyNameMapForType property.

    Declaration
    public PropertiesComparerConfiguration<T> Map<TTo>(Expression<Func<T, object?>> from, Expression<Func<TTo, object?>> to)
    Parameters
    Type Name Description
    Expression<Func<T, object>> from

    The name to map from.

    Expression<Func<TTo, object>> to

    The name to map to.

    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    Type Parameters
    Name Description
    TTo
    Remarks

    Implies AllowDifferentTypes()

    View Source

    Map<TFrom>(Expression<Func<TFrom, object?>>, object?)

    Updates the NUnit.Framework.Constraints.PropertiesComparerConfiguration.PropertyNameToValueMapForType property.

    Declaration
    public PropertiesComparerConfiguration<T> Map<TFrom>(Expression<Func<TFrom, object?>> from, object? value)
    Parameters
    Type Name Description
    Expression<Func<TFrom, object>> from

    The name to map from.

    object value

    The value to use for a propery with name from.

    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    Type Parameters
    Name Description
    TFrom
    Remarks

    Implies AllowDifferentTypes()

    View Source

    Map<TTo>(params (Expression<Func<T, object?>> From, Expression<Func<TTo, object?>> To)[])

    Set the NUnit.Framework.Constraints.PropertiesComparerConfiguration.PropertyNameMapForType property.

    Declaration
    public PropertiesComparerConfiguration<T> Map<TTo>(params (Expression<Func<T, object?>> From, Expression<Func<TTo, object?>> To)[] properties)
    Parameters
    Type Name Description
    (Expression<Func<T, object>> From, Expression<Func<TTo, object>> To)[] properties

    List of properties to map for comparison.

    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    Type Parameters
    Name Description
    TTo
    Remarks

    Implies AllowDifferentTypes()

    View Source

    Map<TFrom, TTo>(Expression<Func<TFrom, object?>>, Expression<Func<TTo, object?>>)

    Updates the NUnit.Framework.Constraints.PropertiesComparerConfiguration.PropertyNameMapForType property.

    Declaration
    public PropertiesComparerConfiguration<T> Map<TFrom, TTo>(Expression<Func<TFrom, object?>> from, Expression<Func<TTo, object?>> to)
    Parameters
    Type Name Description
    Expression<Func<TFrom, object>> from

    The name to map from.

    Expression<Func<TTo, object>> to

    The name to map to.

    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    Type Parameters
    Name Description
    TFrom
    TTo
    Remarks

    Implies AllowDifferentTypes()

    View Source

    Map<TFrom, TTo>(params (Expression<Func<TFrom, object?>> From, Expression<Func<TTo, object?>> To)[])

    Set the NUnit.Framework.Constraints.PropertiesComparerConfiguration.PropertyNameMapForType property.

    Declaration
    public PropertiesComparerConfiguration<T> Map<TFrom, TTo>(params (Expression<Func<TFrom, object?>> From, Expression<Func<TTo, object?>> To)[] properties)
    Parameters
    Type Name Description
    (Expression<Func<TFrom, object>> From, Expression<Func<TTo, object>> To)[] properties

    List of properties to map for comparison.

    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    Type Parameters
    Name Description
    TFrom
    TTo
    Remarks

    Implies AllowDifferentTypes()

    View Source

    Using(params Expression<Func<T, object?>>[])

    Set the NUnit.Framework.Constraints.PropertiesComparerConfiguration.PropertyNamesToUseForType property.

    Declaration
    public PropertiesComparerConfiguration<T> Using(params Expression<Func<T, object?>>[] properties)
    Parameters
    Type Name Description
    Expression<Func<T, object>>[] properties

    List of properties to use for comparison.

    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    View Source

    Using<TFrom>(params Expression<Func<TFrom, object?>>[])

    Set the NUnit.Framework.Constraints.PropertiesComparerConfiguration.PropertyNamesToUseForType property.

    Declaration
    public PropertiesComparerConfiguration<T> Using<TFrom>(params Expression<Func<TFrom, object?>>[] properties)
    Parameters
    Type Name Description
    Expression<Func<TFrom, object>>[] properties

    List of properties to use for comparison.

    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    Type Parameters
    Name Description
    TFrom
    View Source

    Within(object)

    Specify a tolerance for all numeric comparisons.

    Declaration
    public PropertiesComparerConfiguration<T> Within(object amount)
    Parameters
    Type Name Description
    object amount

    The tolerance to apply.

    Returns
    Type Description
    PropertiesComparerConfiguration<T>

    Self.

    • View Source
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0