From 7b1dff5b101fcdcb11f1d737e2d99e14e41c79d1 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 31 Dec 2021 00:30:00 +0100 Subject: [PATCH] Throw exception when calling object.Equals on Assertions class --- .../Numeric/NumericAssertions.cs | 6 +++++ .../Primitives/BooleanAssertions.cs | 9 +++++++- .../Primitives/DateTimeAssertions.cs | 6 +++++ .../Primitives/DateTimeOffsetAssertions.cs | 6 +++++ .../DateTimeOffsetRangeAssertions.cs | 6 +++++ .../Primitives/DateTimeRangeAssertions.cs | 6 +++++ .../Primitives/EnumAssertions.cs | 6 +++++ .../Primitives/GuidAssertions.cs | 6 +++++ .../Primitives/ReferenceTypeAssertions.cs | 6 +++++ .../Primitives/SimpleTimeSpanAssertions.cs | 6 +++++ .../Specialized/ExecutionTimeAssertions.cs | 6 +++++ .../TaskCompletionSourceAssertions.cs | 6 +++++ .../Types/MethodInfoSelectorAssertions.cs | 6 +++++ .../Types/PropertyInfoSelectorAssertions.cs | 6 +++++ .../Types/TypeSelectorAssertions.cs | 6 +++++ .../FluentAssertions/net47.verified.txt | 15 ++++++++++++ .../netcoreapp2.1.verified.txt | 15 ++++++++++++ .../netcoreapp3.0.verified.txt | 15 ++++++++++++ .../netstandard2.0.verified.txt | 15 ++++++++++++ .../netstandard2.1.verified.txt | 15 ++++++++++++ .../AssertionExtensionsSpecs.cs | 23 +++++++++++++++++++ ...GenericCollectionAssertionOfStringSpecs.cs | 1 + 22 files changed, 191 insertions(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Numeric/NumericAssertions.cs b/Src/FluentAssertions/Numeric/NumericAssertions.cs index f0a230a1be..842f08a374 100644 --- a/Src/FluentAssertions/Numeric/NumericAssertions.cs +++ b/Src/FluentAssertions/Numeric/NumericAssertions.cs @@ -22,6 +22,8 @@ public NumericAssertions(T value) } } +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that an is in the expected state. /// @@ -443,5 +445,9 @@ public AndConstraint NotBeOfType(Type unexpectedType, string becaus return new AndConstraint((TAssertions)this); } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Primitives/BooleanAssertions.cs b/Src/FluentAssertions/Primitives/BooleanAssertions.cs index d90fd80170..732ba3830b 100644 --- a/Src/FluentAssertions/Primitives/BooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/BooleanAssertions.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using FluentAssertions.Execution; namespace FluentAssertions.Primitives @@ -16,6 +17,8 @@ public BooleanAssertions(bool? value) } } +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that a is in the expected state. /// @@ -114,5 +117,9 @@ public AndConstraint NotBe(bool unexpected, string because = "", pa return new AndConstraint((TAssertions)this); } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs index 8d9a15a955..f40c2032f0 100644 --- a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs @@ -22,6 +22,8 @@ public DateTimeAssertions(DateTime? value) } } +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that a is in the expected state. /// @@ -920,5 +922,9 @@ public AndConstraint BeIn(DateTimeKind expectedKind, string because return new AndConstraint((TAssertions)this); } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs index 33e57e59c7..4272688927 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs @@ -23,6 +23,8 @@ public DateTimeOffsetAssertions(DateTimeOffset? value) } } +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that a is in the expected state. /// @@ -1089,5 +1091,9 @@ public AndConstraint BeOneOf(IEnumerable validValu return new AndConstraint((TAssertions)this); } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs index 652b2ecb76..587da0ce20 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs @@ -6,6 +6,8 @@ namespace FluentAssertions.Primitives { +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that two objects differ in the expected way. /// @@ -127,5 +129,9 @@ private static string PositionRelativeToTarget(DateTimeOffset actual, DateTimeOf { return actual - target >= TimeSpan.Zero ? "ahead" : "behind"; } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs index 76bbd0a836..4d483f4f7f 100644 --- a/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs @@ -5,6 +5,8 @@ namespace FluentAssertions.Primitives { +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that two objects differ in the expected way. /// @@ -130,5 +132,9 @@ private static string PositionRelativeToTarget(DateTime actual, DateTime target) { return actual - target >= TimeSpan.Zero ? "ahead" : "behind"; } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Primitives/EnumAssertions.cs b/Src/FluentAssertions/Primitives/EnumAssertions.cs index c2d3715858..c072123095 100644 --- a/Src/FluentAssertions/Primitives/EnumAssertions.cs +++ b/Src/FluentAssertions/Primitives/EnumAssertions.cs @@ -20,6 +20,8 @@ public EnumAssertions(TEnum subject) } } +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that a is in the expected state. /// @@ -386,5 +388,9 @@ private static string GetName(T @enum) { return @enum.ToString(); } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Primitives/GuidAssertions.cs b/Src/FluentAssertions/Primitives/GuidAssertions.cs index 2cd1914087..4d7e0ebc6e 100644 --- a/Src/FluentAssertions/Primitives/GuidAssertions.cs +++ b/Src/FluentAssertions/Primitives/GuidAssertions.cs @@ -16,6 +16,8 @@ public GuidAssertions(Guid? value) } } +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that a is in the correct state. /// @@ -166,5 +168,9 @@ public AndConstraint NotBe(Guid unexpected, string because = "", pa } #endregion + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs index 2eb7fae525..b3a56a1e56 100644 --- a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs +++ b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs @@ -6,6 +6,8 @@ namespace FluentAssertions.Primitives { +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that a reference type object is in the expected state. /// @@ -416,5 +418,9 @@ public AndConstraint NotBeAssignableTo(Type type, string because = /// Returns the type of the subject the assertion applies on. /// protected abstract string Identifier { get; } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs index 023e091714..9def21a654 100644 --- a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs @@ -17,6 +17,8 @@ public SimpleTimeSpanAssertions(TimeSpan? value) } } +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that a nullable is in the expected state. /// @@ -338,5 +340,9 @@ public AndConstraint BeGreaterThan(TimeSpan expected, string becaus return new AndConstraint((TAssertions)this); } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs index 507e49e2c1..2c5b15692b 100644 --- a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs @@ -4,6 +4,8 @@ namespace FluentAssertions.Specialized { +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Provides methods for asserting that the execution time of an satisfies certain conditions. /// @@ -225,5 +227,9 @@ public AndConstraint BeCloseTo(TimeSpan expectedDuratio return new AndConstraint(this); } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs index 1c7d0ddbdb..f64c16f50a 100644 --- a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs +++ b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs @@ -6,6 +6,8 @@ namespace FluentAssertions.Specialized { +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals public class TaskCompletionSourceAssertions { private readonly TaskCompletionSource subject; @@ -95,5 +97,9 @@ public TaskCompletionSourceAssertions(TaskCompletionSource tcs, IClock clock) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:task} to not complete within {0}{reason}.", timeSpan); } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs b/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs index 37e7f8209c..3af1f0a49a 100644 --- a/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs @@ -9,6 +9,8 @@ namespace FluentAssertions.Types { +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains assertions for the objects returned by the parent . /// @@ -325,5 +327,9 @@ private static string GetDescriptionsFor(IEnumerable methods) #pragma warning disable CA1822 // Do not change signature of a public member protected string Context => "method"; #pragma warning restore CA1822 + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs b/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs index 2d9c12f08d..27b22710d2 100644 --- a/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs @@ -8,6 +8,8 @@ namespace FluentAssertions.Types { +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains assertions for the objects returned by the parent . /// @@ -224,5 +226,9 @@ private static string GetDescriptionsFor(IEnumerable properties) #pragma warning disable CA1822 // Do not change signature of a public member protected string Context => "property info"; #pragma warning restore CA1822 + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Src/FluentAssertions/Types/TypeSelectorAssertions.cs b/Src/FluentAssertions/Types/TypeSelectorAssertions.cs index 822f377237..9e99e15a3c 100644 --- a/Src/FluentAssertions/Types/TypeSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/TypeSelectorAssertions.cs @@ -8,6 +8,8 @@ namespace FluentAssertions.Types { +#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that all s in a /// meet certain expectations. @@ -472,5 +474,9 @@ private static string GetDescriptionFor(Type type) { return type.ToString(); } + + /// + public override bool Equals(object obj) => + throw new NotSupportedException("Calling Equals on Assertion classes is not supported."); } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 699586487f..ee73949aa0 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1716,6 +1716,7 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T? unexpected, string because = "", params object[] becauseArgs) { } @@ -1737,6 +1738,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeTrue(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(bool unexpected, string because = "", params object[] becauseArgs) { } } public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions @@ -1766,6 +1768,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.Primitives.DateTimeRangeAssertions BeWithin(System.TimeSpan timeSpan) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } @@ -1815,6 +1818,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeWithin(System.TimeSpan timeSpan) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } @@ -1846,6 +1850,7 @@ namespace FluentAssertions.Primitives protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class DateTimeRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions @@ -1853,6 +1858,7 @@ namespace FluentAssertions.Primitives protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> where TEnum : struct, System.Enum @@ -1869,6 +1875,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params TEnum[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveFlag(TEnum expectedFlag, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveSameNameAs(T expected, string because = "", params object[] becauseArgs) where T : struct, System.Enum { } @@ -1897,6 +1904,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(System.Guid unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } @@ -2014,6 +2022,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint BeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameAs(TSubject expected, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) where T : TSubject { } @@ -2043,6 +2052,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeCloseTo(System.TimeSpan distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } } @@ -2205,6 +2215,7 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> { @@ -2242,6 +2253,7 @@ namespace FluentAssertions.Specialized public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public System.Threading.Tasks.Task NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } } } @@ -2369,6 +2381,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) @@ -2422,6 +2435,7 @@ namespace FluentAssertions.Types where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } @@ -2552,6 +2566,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint BeInNamespace(string @namespace, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSealed(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeUnderNamespace(string @namespace, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt index 899a8fa371..d5b927c7d6 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt @@ -1716,6 +1716,7 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T? unexpected, string because = "", params object[] becauseArgs) { } @@ -1737,6 +1738,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeTrue(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(bool unexpected, string because = "", params object[] becauseArgs) { } } public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions @@ -1766,6 +1768,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.Primitives.DateTimeRangeAssertions BeWithin(System.TimeSpan timeSpan) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } @@ -1815,6 +1818,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeWithin(System.TimeSpan timeSpan) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } @@ -1846,6 +1850,7 @@ namespace FluentAssertions.Primitives protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class DateTimeRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions @@ -1853,6 +1858,7 @@ namespace FluentAssertions.Primitives protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> where TEnum : struct, System.Enum @@ -1869,6 +1875,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params TEnum[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveFlag(TEnum expectedFlag, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveSameNameAs(T expected, string because = "", params object[] becauseArgs) where T : struct, System.Enum { } @@ -1897,6 +1904,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(System.Guid unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } @@ -2014,6 +2022,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint BeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameAs(TSubject expected, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) where T : TSubject { } @@ -2043,6 +2052,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeCloseTo(System.TimeSpan distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } } @@ -2205,6 +2215,7 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> { @@ -2242,6 +2253,7 @@ namespace FluentAssertions.Specialized public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public System.Threading.Tasks.Task NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } } } @@ -2371,6 +2383,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) @@ -2424,6 +2437,7 @@ namespace FluentAssertions.Types where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } @@ -2554,6 +2568,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint BeInNamespace(string @namespace, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSealed(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeUnderNamespace(string @namespace, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt index 7f556582e5..62d7b60d9a 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt @@ -1716,6 +1716,7 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T? unexpected, string because = "", params object[] becauseArgs) { } @@ -1737,6 +1738,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeTrue(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(bool unexpected, string because = "", params object[] becauseArgs) { } } public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions @@ -1766,6 +1768,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.Primitives.DateTimeRangeAssertions BeWithin(System.TimeSpan timeSpan) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } @@ -1815,6 +1818,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeWithin(System.TimeSpan timeSpan) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } @@ -1846,6 +1850,7 @@ namespace FluentAssertions.Primitives protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class DateTimeRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions @@ -1853,6 +1858,7 @@ namespace FluentAssertions.Primitives protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> where TEnum : struct, System.Enum @@ -1869,6 +1875,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params TEnum[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveFlag(TEnum expectedFlag, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveSameNameAs(T expected, string because = "", params object[] becauseArgs) where T : struct, System.Enum { } @@ -1897,6 +1904,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(System.Guid unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } @@ -2014,6 +2022,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint BeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameAs(TSubject expected, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) where T : TSubject { } @@ -2043,6 +2052,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeCloseTo(System.TimeSpan distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } } @@ -2205,6 +2215,7 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> { @@ -2242,6 +2253,7 @@ namespace FluentAssertions.Specialized public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public System.Threading.Tasks.Task NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } } } @@ -2371,6 +2383,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) @@ -2424,6 +2437,7 @@ namespace FluentAssertions.Types where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } @@ -2554,6 +2568,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint BeInNamespace(string @namespace, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSealed(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeUnderNamespace(string @namespace, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 53785804ce..45c197d938 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1669,6 +1669,7 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T? unexpected, string because = "", params object[] becauseArgs) { } @@ -1690,6 +1691,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeTrue(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(bool unexpected, string because = "", params object[] becauseArgs) { } } public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions @@ -1719,6 +1721,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.Primitives.DateTimeRangeAssertions BeWithin(System.TimeSpan timeSpan) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } @@ -1768,6 +1771,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeWithin(System.TimeSpan timeSpan) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } @@ -1799,6 +1803,7 @@ namespace FluentAssertions.Primitives protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class DateTimeRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions @@ -1806,6 +1811,7 @@ namespace FluentAssertions.Primitives protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> where TEnum : struct, System.Enum @@ -1822,6 +1828,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params TEnum[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveFlag(TEnum expectedFlag, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveSameNameAs(T expected, string because = "", params object[] becauseArgs) where T : struct, System.Enum { } @@ -1850,6 +1857,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(System.Guid unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } @@ -1967,6 +1975,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint BeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameAs(TSubject expected, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) where T : TSubject { } @@ -1996,6 +2005,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeCloseTo(System.TimeSpan distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } } @@ -2158,6 +2168,7 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> { @@ -2195,6 +2206,7 @@ namespace FluentAssertions.Specialized public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public System.Threading.Tasks.Task NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } } } @@ -2322,6 +2334,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) @@ -2375,6 +2388,7 @@ namespace FluentAssertions.Types where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } @@ -2505,6 +2519,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint BeInNamespace(string @namespace, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSealed(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeUnderNamespace(string @namespace, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 0f1938cc2a..49ebf2d8c8 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1716,6 +1716,7 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint BeOneOf(params T[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(T? unexpected, string because = "", params object[] becauseArgs) { } @@ -1737,6 +1738,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeTrue(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(bool unexpected, string because = "", params object[] becauseArgs) { } } public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions @@ -1766,6 +1768,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.Primitives.DateTimeRangeAssertions BeWithin(System.TimeSpan timeSpan) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } @@ -1815,6 +1818,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeWithin(System.TimeSpan timeSpan) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } @@ -1846,6 +1850,7 @@ namespace FluentAssertions.Primitives protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class DateTimeRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions @@ -1853,6 +1858,7 @@ namespace FluentAssertions.Primitives protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> where TEnum : struct, System.Enum @@ -1869,6 +1875,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params TEnum[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveFlag(TEnum expectedFlag, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveSameNameAs(T expected, string because = "", params object[] becauseArgs) where T : struct, System.Enum { } @@ -1897,6 +1904,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(System.Guid unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } @@ -2014,6 +2022,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint BeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameAs(TSubject expected, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) where T : TSubject { } @@ -2043,6 +2052,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeCloseTo(System.TimeSpan distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } } @@ -2205,6 +2215,7 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } } public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> { @@ -2242,6 +2253,7 @@ namespace FluentAssertions.Specialized public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public System.Threading.Tasks.Task NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } } } @@ -2371,6 +2383,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBe(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) @@ -2424,6 +2437,7 @@ namespace FluentAssertions.Types where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } @@ -2554,6 +2568,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint BeInNamespace(string @namespace, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSealed(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeUnderNamespace(string @namespace, string because = "", params object[] becauseArgs) { } + public override bool Equals(object obj) { } public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) diff --git a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs index 5508937af9..e4d55a2028 100644 --- a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs @@ -9,6 +9,29 @@ namespace FluentAssertions.Specs { public class AssertionExtensionsSpecs { + [Fact] + public void Assertions_classes_have_overriden_equals() + { + // Arrange / Act + var equalsOverloads = AllTypes.From(typeof(FluentAssertions.AssertionExtensions).Assembly) + .ThatAreClasses() + .Where(t => t.IsPublic && t.Name.TrimEnd('`', '1', '2', '3').EndsWith("Assertions", StringComparison.Ordinal)) + .Select(e => GetMostParentType(e)) + .Distinct() + .Select(t => (type: t, overridesEquals: OverridesEquals(t))) + .ToList(); + + // Assert + equalsOverloads.Should().OnlyContain(e => e.overridesEquals); + } + + private static bool OverridesEquals(Type t) + { + MethodInfo equals = t.GetMethod("Equals", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public, + null, new[] { typeof(object) }, null); + return equals is not null; + } + [Fact] public void Should_methods_have_a_matching_overload_to_guard_against_chaining_and_constraints() { diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs index 828e14a0dd..bc5ececcc1 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs @@ -1664,6 +1664,7 @@ public void When_using_StringCollectionAssertions_the_AndConstraint_should_have_ from method in methodInfo where !method.IsSpecialName // Exclude Properties where method.DeclaringType != typeof(object) + where method.Name != "Equals" select new { method.Name, method.ReturnType }; // Assert