-
Notifications
You must be signed in to change notification settings - Fork 291
Description
Original issue was to remove this overload in v4:
testfx/src/TestFramework/TestFramework/Assertions/Assert.cs
Lines 144 to 161 in b7c0d0a
| /// <summary> | |
| /// Static equals overloads are used for comparing instances of two types for reference | |
| /// equality. This method should <b>not</b> be used for comparison of two instances for | |
| /// equality. This object will <b>always</b> throw with Assert.Fail. Please use | |
| /// Assert.AreEqual and associated overloads in your unit tests. | |
| /// </summary> | |
| /// <param name="objA"> Object A. </param> | |
| /// <param name="objB"> Object B. </param> | |
| /// <returns> False, always. </returns> | |
| [SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "obj", Justification = "We want to compare 'object A' with 'object B', so it makes sense to have 'obj' in the parameter name")] | |
| #pragma warning disable IDE0060 // Remove unused parameter | |
| public static new bool Equals(object? objA, object? objB) | |
| #pragma warning restore IDE0060 // Remove unused parameter | |
| { | |
| Fail(FrameworkMessages.DoNotUseAssertEquals); | |
| return false; | |
| } | |
| #endregion |
But we shouldn't. See comment below.
Copilot