Class PropertiesComparerConfiguration<T>
Generic version of PropertiesComparerConfiguration to allow specifiying properties using expression syntax instead of strings.
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class PropertiesComparerConfiguration<T> : PropertiesComparerConfiguration
Type Parameters
Name | Description |
---|---|
T |
Constructors
View SourcePropertiesComparerConfiguration()
Declaration
public PropertiesComparerConfiguration()
Methods
View SourceAllowDifferentTypes()
Set the NUnit.Framework.Constraints.PropertiesComparerConfiguration.AllowComparingDifferentTypes property.
Declaration
public PropertiesComparerConfiguration<T> AllowDifferentTypes()
Returns
Type | Description |
---|---|
PropertiesComparerConfiguration<T> | Self. |
CompareOnlyCommonProperties()
Set the NUnit.Framework.Constraints.PropertiesComparerConfiguration.OnlyCompareCommonProperties property.
Declaration
public PropertiesComparerConfiguration<T> CompareOnlyCommonProperties()
Returns
Type | Description |
---|---|
PropertiesComparerConfiguration<T> | Self. |
Remarks
Implies AllowDifferentTypes()
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. |
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 |
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()
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 |
Returns
Type | Description |
---|---|
PropertiesComparerConfiguration<T> | Self. |
Type Parameters
Name | Description |
---|---|
TFrom |
Remarks
Implies AllowDifferentTypes()
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()
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()
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()
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. |
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 |
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. |