Replacement of .IsSameOrEqualTo() for extensions in v6.0 #1644
-
I'm working with an extension that uses public TObjectResultAssertion WithValue(object expectedValue, string reason = "", params object[] reasonArgs)
{
object actualValue = ObjectResultSubject.Value;
Execute.Assertion
.BecauseOf(reason, reasonArgs)
.ForCondition(actualValue.IsSameOrEqualTo(expectedValue))
.WithDefaultIdentifier(Identifier + ".Value")
.FailWith(FailureMessages.CommonFailMessage, expectedValue, actualValue);
return (TObjectResultAssertion)this;
}
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Since it's an internal piece of code, it was never meant to be reused outside our code base. But you can still copy the code if you really need it. Although in most cases, a simple |
Beta Was this translation helpful? Give feedback.
-
Hi, if (actualValue.Equals(expectedValue.Value))
{
} |
Beta Was this translation helpful? Give feedback.
Since it's an internal piece of code, it was never meant to be reused outside our code base. But you can still copy the code if you really need it. Although in most cases, a simple
Equals
should suffice.