Skip to content

Commit

Permalink
Add new overload to list of modifiers for other constraints.
Browse files Browse the repository at this point in the history
  • Loading branch information
manfred-brands committed Mar 10, 2025
1 parent c664668 commit 73a7692
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ Is.AnyOf(object[] expected)
...Using<T>(Comparison<T> comparer)
...Using<T>(Func<T, T, bool> comparer)
...UsingPropertiesComparer() // From version 4.1
...UsingPropertiesComparer(
Func<PropertiesComparerConfiguration,
PropertiesComparerConfiguration> configure) // From version 4.4
```

## Examples of Use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Is.EquivalentTo(IEnumerable other)
...Using<T>(Func<T, T, bool> comparer)
...Using<TActualElement, TExpectedElement>(Func<TActualElement, TExpectedElement, bool> comparison)
...UsingPropertiesComparer() // From version 4.1
...UsingPropertiesComparer(
Func<PropertiesComparerConfiguration,
PropertiesComparerConfiguration> configure) // From version 4.4
```

## Examples of Use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Is.SubsetOf(IEnumerable)
...Using<T>(Func<T, T, bool> comparer)
...Using<TSubsetElement, TSupersetElement>(Func<TSubsetElement, TSupersetElement, bool> comparison)
...UsingPropertiesComparer() // From version 4.1
...UsingPropertiesComparer(
Func<PropertiesComparerConfiguration,
PropertiesComparerConfiguration> configure) // From version 4.4
```

## Example of Use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Is.SupersetOf(IEnumerable)
...Using<T>(Func<T, T, bool> comparer)
...Using<TSupersetElement, TSubsetElement>(Func<TSupersetElement, TSubsetElement, bool> comparison)
...UsingPropertiesComparer() // From version 4.1
...UsingPropertiesComparer(
Func<PropertiesComparerConfiguration,
PropertiesComparerConfiguration> configure) // From version 4.4
```

## Example of Use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Does.Not.ContainKey(object)
...Using<T>(Comparison<T> comparer)
...Using<T>(Func<T, T, bool> comparer)
...UsingPropertiesComparer() // From version 4.1
...UsingPropertiesComparer(
Func<PropertiesComparerConfiguration,
PropertiesComparerConfiguration> configure) // From version 4.4
...WithValue(object expectedValue)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ Assert.That(dictionary, new DictionaryContainsKeyValuePairConstraint("HI", "UNIV
...Using<T>(Func<T, T, bool> comparer)
...Using<T>(IEqualityComparer<T> comparer)
...UsingPropertiesComparer() // From version 4.1
...UsingPropertiesComparer(
Func<PropertiesComparerConfiguration,
PropertiesComparerConfiguration> configure) // From version 4.4
```

## See also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Does.Not.ContainValue(object)
...Using<T>(IEqualityComparer<T> comparer)
...Using<TActualValueElement, TExpected>(Func<TActualValueElement, TExpected, bool> comparison)
...UsingPropertiesComparer() // From version 4.1
...UsingPropertiesComparer(
Func<PropertiesComparerConfiguration,
PropertiesComparerConfiguration> configure) // From version 4.4
```

## Examples of Use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ Is.Zero // Equivalent to Is.EqualTo(0)
...Using<T>(Func<T, T, bool> comparer)
...Using<TActual, TExpected>(Func<TActual, TExpected, bool> comparer)
...UsingPropertiesComparer() // From version 4.1
...UsingPropertiesComparer(
Func<PropertiesComparerConfiguration,
PropertiesComparerConfiguration> configure) // From version 4.4
```

## Comparing Numerics
Expand Down Expand Up @@ -290,7 +293,7 @@ This can be useful when comparing floating point numbers of calculation results.
The comparer can deal with recursive data structures,
it will stop comparing if it already previously has compared two the same instances.

There is an overload of `UsingPropertiesComparer` which allows tailoring the comparison.
From version 4.4 there is a new overload of `UsingPropertiesComparer` which allows tailoring the comparison.
This overload expects delegate that accepts a `PropertiesComparerConfiguration` and
also returns a `PropertiesComparerConfiguration`.

Expand Down Expand Up @@ -348,6 +351,7 @@ You can do this with the `Using` method.

There are two overloads, one expecting a `string` and the other a type safe `Expression`.
The latter has the advantage that you get intellisense helping you with available property names.
However, that overload is only available on some constraints which have been update with a generic type parameter.

```csharp
private record struct Person(string Name, int YearOfBirth);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Has.Some...
...Using<T>(Comparison<T> comparer)
...Using<TActualCollectionElement, TExpectedElement>(Func<TActualCollectionElement, TExpectedElement, bool> comparer)
...UsingPropertiesComparer() // From version 4.1
...UsingPropertiesComparer(
Func<PropertiesComparerConfiguration,
PropertiesComparerConfiguration> configure) // From version 4.4
```

## Examples of Use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Is.Unique
...Using<T>(Comparison<T> comparer)
...Using<T>(Func<T, T, bool> comparer)
...UsingPropertiesComparer() // From version 4.1
...UsingPropertiesComparer(
Func<PropertiesComparerConfiguration,
PropertiesComparerConfiguration> configure) // From version 4.4
```

## Example of Use
Expand Down

0 comments on commit 73a7692

Please sign in to comment.