forked from fluentassertions/fluentassertions
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f85480
commit eda0f53
Showing
136 changed files
with
2,057 additions
and
1,837 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
347 changes: 149 additions & 198 deletions
347
Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
Large diffs are not rendered by default.
Oops, something went wrong.
99 changes: 51 additions & 48 deletions
99
Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
namespace FluentAssertions.Equivalency; | ||
using FluentAssertions.Execution; | ||
|
||
namespace FluentAssertions.Equivalency; | ||
|
||
/// <summary> | ||
/// Convenient implementation of <see cref="IEquivalencyStep"/> that will only invoke | ||
/// </summary> | ||
public abstract class EquivalencyStep<T> : IEquivalencyStep | ||
{ | ||
public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, | ||
IEquivalencyValidator nestedValidator) | ||
public EquivalencyResult Handle(Comparands comparands, Assertion assertion, IEquivalencyValidationContext context, | ||
IValidateChildNodeEquivalency nestedValidator) | ||
{ | ||
if (!typeof(T).IsAssignableFrom(comparands.GetExpectedType(context.Options))) | ||
{ | ||
return EquivalencyResult.ContinueWithNext; | ||
} | ||
|
||
return OnHandle(comparands, context, nestedValidator); | ||
return OnHandle(comparands, assertion, context, nestedValidator); | ||
} | ||
|
||
/// <summary> | ||
/// Implements <see cref="IEquivalencyStep.Handle"/>, but only gets called when the expected type matches <typeparamref name="T"/>. | ||
/// </summary> | ||
protected abstract EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, | ||
IEquivalencyValidator nestedValidator); | ||
protected abstract EquivalencyResult OnHandle(Comparands comparands, Assertion assertion, | ||
IEquivalencyValidationContext context, | ||
IValidateChildNodeEquivalency nestedValidator); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
Src/FluentAssertions/Equivalency/IValidateChildNodeEquivalency.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using FluentAssertions.Execution; | ||
|
||
namespace FluentAssertions.Equivalency; | ||
|
||
public interface IValidateChildNodeEquivalency | ||
{ | ||
/// <summary> | ||
/// Runs a deep recursive equivalency assertion on the provided <paramref name="comparands"/>. | ||
/// </summary> | ||
void AssertEquivalencyOf(Comparands comparands, Assertion assertion, IEquivalencyValidationContext context); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.