Assert.AreNotEqual Method

Definition

Overloads

AreNotEqual(String, String, Boolean, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

AreNotEqual(String, String, Boolean, CultureInfo)

Tests whether the specified strings are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, String)

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

AreNotEqual(Decimal, Decimal, Decimal, String, Object[])

Tests whether the specified decimals are unequal and throws an exception if they are equal.

AreNotEqual(Double, Double, Double, String, Object[])

Tests whether the specified doubles are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, CultureInfo, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified strings are unequal and throws an exception if they are equal.

AreNotEqual(Single, Single, Single, String, Object[])

Tests whether the specified floats are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, CultureInfo, String)

Tests whether the specified strings are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, String, Object[])

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

AreNotEqual(String, String, Boolean, CultureInfo, String, Object[])

Tests whether the specified strings are unequal and throws an exception if they are equal.

AreNotEqual(Single, Single, Single, String)

Tests whether the specified floats are unequal and throws an exception if they are equal.

AreNotEqual(Int64, Int64, Int64, String, Object[])

Tests whether the specified longs are unequal and throws an exception if they are equal.

AreNotEqual(Single, Single, Single, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified floats are unequal and throws an exception if they are equal.

AreNotEqual(Double, Double, Double, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified doubles are unequal and throws an exception if they are equal.

AreNotEqual(Int64, Int64, Int64, String)

Tests whether the specified longs are unequal and throws an exception if they are equal.

AreNotEqual(Object, Object)

Tests whether the specified objects are unequal and throws an exception if the two objects are equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

AreNotEqual(Decimal, Decimal, Decimal)

Tests whether the specified decimals are unequal and throws an exception if they are equal.

AreNotEqual(Int64, Int64, Int64)

Tests whether the specified longs are unequal and throws an exception if they are equal.

AreNotEqual(Object, Object, String)

Tests whether the specified objects are unequal and throws an exception if the two objects are equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

AreNotEqual(Single, Single, Single)

Tests whether the specified floats are unequal and throws an exception if they are equal.

AreNotEqual(Double, Double, Double)

Tests whether the specified doubles are unequal and throws an exception if they are equal.

AreNotEqual(Decimal, Decimal, Decimal, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified decimals are unequal and throws an exception if they are equal.

AreNotEqual(Decimal, Decimal, Decimal, String)

Tests whether the specified decimals are unequal and throws an exception if they are equal.

AreNotEqual(Double, Double, Double, String)

Tests whether the specified doubles are unequal and throws an exception if they are equal.

AreNotEqual(Int64, Int64, Int64, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified longs are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean)

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

AreNotEqual(Object, Object, String, Object[])

Tests whether the specified objects are unequal and throws an exception if the two objects are equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

AreNotEqual<T>(T, T, IEqualityComparer<T>, String, Object[])

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the provided comparer parameter.

AreNotEqual<T>(T, T)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T, Assert.AssertAreNotEqualInterpolatedStringHandler<T>)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T, IEqualityComparer<T>)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the provided comparer parameter.

AreNotEqual<T>(T, T, String)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T, IEqualityComparer<T>, Assert.AssertAreNotEqualInterpolatedStringHandler<T>)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T, IEqualityComparer<T>, String)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the provided comparer parameter.

AreNotEqual<T>(T, T, String, Object[])

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual(String, String, Boolean, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Source:
Assert.AreEqual.cs

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler message);

Parameters

notExpected
String

The first string to compare. This is the string the test expects not to match actual.

actual
String

The second string to compare. This is the string produced by the code under test.

ignoreCase
Boolean

A Boolean indicating a case-sensitive or insensitive comparison. (true indicates a case-insensitive comparison.)

message
Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

Applies to

MSTest.TestFramework 3.8.0
Produit Versions
MSTest.TestFramework 3.8.0

AreNotEqual(String, String, Boolean, CultureInfo)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified strings are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(string notExpected, string actual, bool ignoreCase, System.Globalization.CultureInfo culture);
C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture);
C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo culture);

Parameters

notExpected
String

The first string to compare. This is the string the test expects not to match actual.

actual
String

The second string to compare. This is the string produced by the code under test.

ignoreCase
Boolean

A Boolean indicating a case-sensitive or insensitive comparison. (true indicates a case-insensitive comparison.)

culture
CultureInfo

A CultureInfo object that supplies culture-specific comparison information. If culture is null, the current culture is used.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(String, String, Boolean, String)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

C#
public static void AreNotEqual(string notExpected, string actual, bool ignoreCase, string message);
C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase, string? message);

Parameters

notExpected
String

The first string to compare. This is the string the test expects not to match actual.

actual
String

The second string to compare. This is the string produced by the code under test.

ignoreCase
Boolean

A Boolean indicating a case-sensitive or insensitive comparison. (true indicates a case-insensitive comparison.)

message
String

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Decimal, Decimal, Decimal, String, Object[])

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified decimals are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(decimal notExpected, decimal actual, decimal delta, string message, params object[] parameters);
C#
public static void AreNotEqual(decimal notExpected, decimal actual, decimal delta, string? message, params object?[]? parameters);

Parameters

notExpected
Decimal

The first decimal to compare. This is the decimal the test expects not to match actual.

actual
Decimal

The second decimal to compare. This is the decimal produced by the code under test.

delta
Decimal

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
String

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Double, Double, Double, String, Object[])

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified doubles are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(double notExpected, double actual, double delta, string message, params object[] parameters);
C#
public static void AreNotEqual(double notExpected, double actual, double delta, string? message, params object?[]? parameters);

Parameters

notExpected
Double

The first double to compare. This is the double the test expects not to match actual.

actual
Double

The second double to compare. This is the double produced by the code under test.

delta
Double

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
String

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(String, String, Boolean, CultureInfo, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Source:
Assert.AreEqual.cs

Tests whether the specified strings are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo culture, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler message);

Parameters

notExpected
String

The first string to compare. This is the string the test expects not to match actual.

actual
String

The second string to compare. This is the string produced by the code under test.

ignoreCase
Boolean

A Boolean indicating a case-sensitive or insensitive comparison. (true indicates a case-insensitive comparison.)

culture
CultureInfo

A CultureInfo object that supplies culture-specific comparison information. If culture is null, the current culture is used.

message
Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

Applies to

MSTest.TestFramework 3.8.0
Produit Versions
MSTest.TestFramework 3.8.0

AreNotEqual(Single, Single, Single, String, Object[])

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified floats are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(float notExpected, float actual, float delta, string message, params object[] parameters);
C#
public static void AreNotEqual(float notExpected, float actual, float delta, string? message, params object?[]? parameters);

Parameters

notExpected
Single

The first float to compare. This is the float the test expects not to match actual.

actual
Single

The second float to compare. This is the float produced by the code under test.

delta
Single

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
String

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(String, String, Boolean, CultureInfo, String)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified strings are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(string notExpected, string actual, bool ignoreCase, System.Globalization.CultureInfo culture, string message);
C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture, string? message);
C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo culture, string? message);

Parameters

notExpected
String

The first string to compare. This is the string the test expects not to match actual.

actual
String

The second string to compare. This is the string produced by the code under test.

ignoreCase
Boolean

A Boolean indicating a case-sensitive or insensitive comparison. (true indicates a case-insensitive comparison.)

culture
CultureInfo

A CultureInfo object that supplies culture-specific comparison information. If culture is null, the current culture is used.

message
String

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(String, String, Boolean, String, Object[])

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

C#
public static void AreNotEqual(string notExpected, string actual, bool ignoreCase, string message, params object[] parameters);
C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase, string? message, params object?[]? parameters);

Parameters

notExpected
String

The first string to compare. This is the string the test expects not to match actual.

actual
String

The second string to compare. This is the string produced by the code under test.

ignoreCase
Boolean

A Boolean indicating a case-sensitive or insensitive comparison. (true indicates a case-insensitive comparison.)

message
String

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(String, String, Boolean, CultureInfo, String, Object[])

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified strings are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(string notExpected, string actual, bool ignoreCase, System.Globalization.CultureInfo culture, string message, params object[] parameters);
C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture, string? message, params object?[]? parameters);
C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo culture, string? message, params object?[]? parameters);

Parameters

notExpected
String

The first string to compare. This is the string the test expects not to match actual.

actual
String

The second string to compare. This is the string produced by the code under test.

ignoreCase
Boolean

A Boolean indicating a case-sensitive or insensitive comparison. (true indicates a case-insensitive comparison.)

culture
CultureInfo

A CultureInfo object that supplies culture-specific comparison information. If culture is null, the current culture is used.

message
String

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Single, Single, Single, String)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified floats are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(float notExpected, float actual, float delta, string message);
C#
public static void AreNotEqual(float notExpected, float actual, float delta, string? message);

Parameters

notExpected
Single

The first float to compare. This is the float the test expects not to match actual.

actual
Single

The second float to compare. This is the float produced by the code under test.

delta
Single

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
String

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Int64, Int64, Int64, String, Object[])

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified longs are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(long notExpected, long actual, long delta, string message, params object[] parameters);
C#
public static void AreNotEqual(long notExpected, long actual, long delta, string? message, params object?[]? parameters);

Parameters

notExpected
Int64

The first long to compare. This is the long the test expects not to match actual.

actual
Int64

The second long to compare. This is the long produced by the code under test.

delta
Int64

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
String

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Single, Single, Single, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Source:
Assert.AreEqual.cs

Tests whether the specified floats are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(float notExpected, float actual, float delta, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler message);

Parameters

notExpected
Single

The first float to compare. This is the float the test expects not to match actual.

actual
Single

The second float to compare. This is the float produced by the code under test.

delta
Single

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

Applies to

MSTest.TestFramework 3.8.0
Produit Versions
MSTest.TestFramework 3.8.0

AreNotEqual(Double, Double, Double, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Source:
Assert.AreEqual.cs

Tests whether the specified doubles are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(double notExpected, double actual, double delta, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler message);

Parameters

notExpected
Double

The first double to compare. This is the double the test expects not to match actual.

actual
Double

The second double to compare. This is the double produced by the code under test.

delta
Double

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

Applies to

MSTest.TestFramework 3.8.0
Produit Versions
MSTest.TestFramework 3.8.0

AreNotEqual(Int64, Int64, Int64, String)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified longs are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(long notExpected, long actual, long delta, string message);
C#
public static void AreNotEqual(long notExpected, long actual, long delta, string? message);

Parameters

notExpected
Int64

The first long to compare. This is the long the test expects not to match actual.

actual
Int64

The second long to compare. This is the long produced by the code under test.

delta
Int64

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
String

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Object, Object)

Tests whether the specified objects are unequal and throws an exception if the two objects are equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

C#
public static void AreNotEqual(object notExpected, object actual);

Parameters

notExpected
Object

The first object to compare. This is the value the test expects not to match actual.

actual
Object

The second object to compare. This is the object produced by the code under test.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 2.2.10 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10

AreNotEqual(Decimal, Decimal, Decimal)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified decimals are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(decimal notExpected, decimal actual, decimal delta);

Parameters

notExpected
Decimal

The first decimal to compare. This is the decimal the test expects not to match actual.

actual
Decimal

The second decimal to compare. This is the decimal produced by the code under test.

delta
Decimal

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Int64, Int64, Int64)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified longs are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(long notExpected, long actual, long delta);

Parameters

notExpected
Int64

The first long to compare. This is the long the test expects not to match actual.

actual
Int64

The second long to compare. This is the long produced by the code under test.

delta
Int64

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Object, Object, String)

Tests whether the specified objects are unequal and throws an exception if the two objects are equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

C#
public static void AreNotEqual(object notExpected, object actual, string message);

Parameters

notExpected
Object

The first object to compare. This is the value the test expects not to match actual.

actual
Object

The second object to compare. This is the object produced by the code under test.

message
String

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 2.2.10 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10

AreNotEqual(Single, Single, Single)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified floats are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(float notExpected, float actual, float delta);

Parameters

notExpected
Single

The first float to compare. This is the float the test expects not to match actual.

actual
Single

The second float to compare. This is the float produced by the code under test.

delta
Single

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Double, Double, Double)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified doubles are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(double notExpected, double actual, double delta);

Parameters

notExpected
Double

The first double to compare. This is the double the test expects not to match actual.

actual
Double

The second double to compare. This is the double produced by the code under test.

delta
Double

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Decimal, Decimal, Decimal, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Source:
Assert.AreEqual.cs

Tests whether the specified decimals are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(decimal notExpected, decimal actual, decimal delta, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler message);

Parameters

notExpected
Decimal

The first decimal to compare. This is the decimal the test expects not to match actual.

actual
Decimal

The second decimal to compare. This is the decimal produced by the code under test.

delta
Decimal

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

Applies to

MSTest.TestFramework 3.8.0
Produit Versions
MSTest.TestFramework 3.8.0

AreNotEqual(Decimal, Decimal, Decimal, String)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified decimals are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(decimal notExpected, decimal actual, decimal delta, string message);
C#
public static void AreNotEqual(decimal notExpected, decimal actual, decimal delta, string? message);

Parameters

notExpected
Decimal

The first decimal to compare. This is the decimal the test expects not to match actual.

actual
Decimal

The second decimal to compare. This is the decimal produced by the code under test.

delta
Decimal

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
String

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Double, Double, Double, String)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified doubles are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(double notExpected, double actual, double delta, string message);
C#
public static void AreNotEqual(double notExpected, double actual, double delta, string? message);

Parameters

notExpected
Double

The first double to compare. This is the double the test expects not to match actual.

actual
Double

The second double to compare. This is the double produced by the code under test.

delta
Double

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
String

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Int64, Int64, Int64, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Source:
Assert.AreEqual.cs

Tests whether the specified longs are unequal and throws an exception if they are equal.

C#
public static void AreNotEqual(long notExpected, long actual, long delta, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler message);

Parameters

notExpected
Int64

The first long to compare. This is the long the test expects not to match actual.

actual
Int64

The second long to compare. This is the long produced by the code under test.

delta
Int64

The required accuracy. An exception will be thrown only if actual is different than notExpected by at most delta.

message
Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertNonGenericAreNotEqualInterpolatedStringHandler

The message to include in the exception when actual is equal to notExpected or different by less than delta. The message is shown in test results.

Applies to

MSTest.TestFramework 3.8.0
Produit Versions
MSTest.TestFramework 3.8.0

AreNotEqual(String, String, Boolean)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

C#
public static void AreNotEqual(string notExpected, string actual, bool ignoreCase);
C#
public static void AreNotEqual(string? notExpected, string? actual, bool ignoreCase);

Parameters

notExpected
String

The first string to compare. This is the string the test expects not to match actual.

actual
String

The second string to compare. This is the string produced by the code under test.

ignoreCase
Boolean

A Boolean indicating a case-sensitive or insensitive comparison. (true indicates a case-insensitive comparison.)

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual(Object, Object, String, Object[])

Tests whether the specified objects are unequal and throws an exception if the two objects are equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

C#
public static void AreNotEqual(object notExpected, object actual, string message, params object[] parameters);

Parameters

notExpected
Object

The first object to compare. This is the value the test expects not to match actual.

actual
Object

The second object to compare. This is the object produced by the code under test.

message
String

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 2.2.10 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10

AreNotEqual<T>(T, T, IEqualityComparer<T>, String, Object[])

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the provided comparer parameter.

C#
public static void AreNotEqual<T>(T? notExpected, T? actual, System.Collections.Generic.IEqualityComparer<T>? comparer, string? message, params object?[]? parameters);

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.

comparer
IEqualityComparer<T>

The IEqualityComparer<T> implementation to use when comparing keys, or null to use the default EqualityComparer<T>.

message
String

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual<T>(T, T)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

C#
public static void AreNotEqual<T>(T notExpected, T actual);
C#
public static void AreNotEqual<T>(T? notExpected, T? actual);

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.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual<T>(T, T, Assert.AssertAreNotEqualInterpolatedStringHandler<T>)

Source:
Assert.AreEqual.cs

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

C#
public static void AreNotEqual<T>(T? notExpected, T? actual, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertAreNotEqualInterpolatedStringHandler<T> message);

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
Assert.AssertAreNotEqualInterpolatedStringHandler<T>

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

Applies to

MSTest.TestFramework 3.8.0
Produit Versions
MSTest.TestFramework 3.8.0

AreNotEqual<T>(T, T, IEqualityComparer<T>)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the provided comparer parameter.

C#
public static void AreNotEqual<T>(T? notExpected, T? actual, System.Collections.Generic.IEqualityComparer<T>? comparer);

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.

comparer
IEqualityComparer<T>

The IEqualityComparer<T> implementation to use when comparing keys, or null to use the default EqualityComparer<T>.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual<T>(T, T, String)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

C#
public static void AreNotEqual<T>(T notExpected, T actual, string message);
C#
public static void AreNotEqual<T>(T? notExpected, T? actual, string? message);

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 equal to notExpected. The message is shown in test results.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual<T>(T, T, IEqualityComparer<T>, Assert.AssertAreNotEqualInterpolatedStringHandler<T>)

Source:
Assert.AreEqual.cs

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

C#
public static void AreNotEqual<T>(T? notExpected, T? actual, System.Collections.Generic.IEqualityComparer<T>? comparer, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertAreNotEqualInterpolatedStringHandler<T> message);

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.

comparer
IEqualityComparer<T>
message
Assert.AssertAreNotEqualInterpolatedStringHandler<T>

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

Applies to

MSTest.TestFramework 3.8.0
Produit Versions
MSTest.TestFramework 3.8.0

AreNotEqual<T>(T, T, IEqualityComparer<T>, String)

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the provided comparer parameter.

C#
public static void AreNotEqual<T>(T? notExpected, T? actual, System.Collections.Generic.IEqualityComparer<T>? comparer, string? message);

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.

comparer
IEqualityComparer<T>

The IEqualityComparer<T> implementation to use when comparing keys, or null to use the default EqualityComparer<T>.

message
String

The message to include in the exception when actual is equal to notExpected. The message is shown in test results.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEqual<T>(T, T, String, Object[])

Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs
Source:
Assert.AreEqual.cs

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

C#
public static void AreNotEqual<T>(T notExpected, T actual, string message, params object[] parameters);
C#
public static void AreNotEqual<T>(T? notExpected, T? actual, string? message, params object?[]? parameters);

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 equal to notExpected. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if notExpected is equal to actual.

Applies to

MSTest.TestFramework 3.8.0 et autres versions
Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0