Assert.AreNotEquivalent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| AreNotEquivalent<T>(T, T, String, String, String) |
Tests whether two object graphs are NOT structurally equivalent and throws an exception if they are. |
| AreNotEquivalent<T>(T, T, Boolean, String, String, String) |
Tests whether two object graphs are NOT structurally equivalent and throws an exception if they are. |
AreNotEquivalent<T>(T, T, String, String, String)
- Source:
- Assert.AreEquivalent.cs
Tests whether two object graphs are NOT structurally equivalent and throws an exception if they are.
public static void AreNotEquivalent<T>(T? notExpected, T? actual, string? message = "", string notExpectedExpression = "", string actualExpression = "");
static member AreNotEquivalent : 'T * 'T * string * string * string -> unit
Public Shared Sub AreNotEquivalent(Of T) (notExpected As T, actual As T, Optional message As String = "", Optional notExpectedExpression As String = "", Optional actualExpression As String = "")
Type Parameters
- T
The type of values to compare.
Parameters
- notExpected
- T
The first value to compare. This is the value the test expects not to match
actual.
- actual
- T
The second value to compare. This is the value produced by the code under test.
- message
- String
The message to include in the exception when actual
is equivalent to notExpected. The message is shown in
test results.
- notExpectedExpression
- String
The syntactic expression of notExpected as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.
- actualExpression
- String
The syntactic expression of actual as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.
Exceptions
Thrown if notExpected and actual are structurally equivalent,
or if the structural comparison cannot be completed.
Remarks
See AreEquivalent<T>(T, T, String, String, String) and AreEquivalent<T>(T, T, Boolean, String, String, String) for the full set of comparison rules.
Applies to
AreNotEquivalent<T>(T, T, Boolean, String, String, String)
- Source:
- Assert.AreEquivalent.cs
Tests whether two object graphs are NOT structurally equivalent and throws an exception if they are.
public static void AreNotEquivalent<T>(T? notExpected, T? actual, bool strict, string? message = "", string notExpectedExpression = "", string actualExpression = "");
static member AreNotEquivalent : 'T * 'T * bool * string * string * string -> unit
Public Shared Sub AreNotEquivalent(Of T) (notExpected As T, actual As T, strict As Boolean, Optional message As String = "", Optional notExpectedExpression As String = "", Optional actualExpression As String = "")
Type Parameters
- T
The type of values to compare.
Parameters
- notExpected
- T
The first value to compare. This is the value the test expects not to match
actual.
- actual
- T
The second value to compare. This is the value produced by the code under test.
- strict
- Boolean
When true, the equivalence check used to decide whether the assertion fails is
performed in strict mode (extra members or dictionary keys on actual are
considered a difference, so the assertion succeeds in their presence).
- message
- String
The message to include in the exception when actual
is equivalent to notExpected. The message is shown in
test results.
- notExpectedExpression
- String
The syntactic expression of notExpected as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.
- actualExpression
- String
The syntactic expression of actual as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.
Exceptions
Thrown if notExpected and actual are structurally equivalent,
or if the structural comparison cannot be completed.