Assert.AreNotEqual Assert.AreNotEqual Assert.AreNotEqual Method

Definition

Overloads

AreNotEqual(String, String, Boolean, String) AreNotEqual(String, String, Boolean, String) 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(String, String, Boolean, CultureInfo, String, Object[]) AreNotEqual(String, String, Boolean, CultureInfo, String, Object[]) AreNotEqual(String, String, Boolean, CultureInfo, String, Object[])

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

AreNotEqual(String, String, Boolean, String, Object[]) AreNotEqual(String, String, Boolean, String, Object[]) 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) AreNotEqual(String, String, Boolean, CultureInfo, String) AreNotEqual(String, String, Boolean, CultureInfo, String)

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

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

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

AreNotEqual(Double, Double, Double, String, Object[]) AreNotEqual(Double, Double, Double, String, Object[]) 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) AreNotEqual(String, String, Boolean, CultureInfo) AreNotEqual(String, String, Boolean, CultureInfo)

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

AreNotEqual(Object, Object) AreNotEqual(Object, Object) 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(Object, Object, String, Object[]) AreNotEqual(Object, Object, String, Object[]) 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(Double, Double, Double, String) AreNotEqual(Double, Double, Double, String) AreNotEqual(Double, Double, Double, String)

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

AreNotEqual(String, String, Boolean) AreNotEqual(String, String, Boolean) 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(Single, Single, Single) AreNotEqual(Single, Single, Single) AreNotEqual(Single, Single, Single)

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

AreNotEqual(Object, Object, String) AreNotEqual(Object, Object, String) 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(Double, Double, Double) AreNotEqual(Double, Double, Double) AreNotEqual(Double, Double, Double)

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

AreNotEqual(Single, Single, Single, String) AreNotEqual(Single, Single, Single, String) AreNotEqual(Single, Single, Single, String)

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

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

Tests whether the specified values are unequal and throws an exception if the two values 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) AreNotEqual<T>(T, T) AreNotEqual<T>(T, T)

Tests whether the specified values are unequal and throws an exception if the two values 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, String) AreNotEqual<T>(T, T, String) AreNotEqual<T>(T, T, String)

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

AreNotEqual(String, String, Boolean, String) AreNotEqual(String, String, Boolean, String) 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.

public static void AreNotEqual (string notExpected, string actual, bool ignoreCase, string message);
static member AreNotEqual : string * string * bool * string -> unit
Public Shared Sub AreNotEqual (notExpected As String, actual As String, ignoreCase As Boolean, message As String)

Parameters

notExpected
String String String

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

actual
String String String

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

ignoreCase
Boolean Boolean Boolean

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

message
String String 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.

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

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

public static void AreNotEqual (string notExpected, string actual, bool ignoreCase, System.Globalization.CultureInfo culture, string message, params object[] parameters);
static member AreNotEqual : string * string * bool * System.Globalization.CultureInfo * string * obj[] -> unit
Public Shared Sub AreNotEqual (notExpected As String, actual As String, ignoreCase As Boolean, culture As CultureInfo, message As String, ParamArray parameters As Object())

Parameters

notExpected
String String String

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

actual
String String String

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

ignoreCase
Boolean Boolean Boolean

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

culture
CultureInfo CultureInfo CultureInfo

A CultureInfo object that supplies culture-specific comparison information.

message
String String 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.

AreNotEqual(String, String, Boolean, String, Object[]) AreNotEqual(String, String, Boolean, String, Object[]) 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.

public static void AreNotEqual (string notExpected, string actual, bool ignoreCase, string message, params object[] parameters);
static member AreNotEqual : string * string * bool * string * obj[] -> unit
Public Shared Sub AreNotEqual (notExpected As String, actual As String, ignoreCase As Boolean, message As String, ParamArray parameters As Object())

Parameters

notExpected
String String String

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

actual
String String String

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

ignoreCase
Boolean Boolean Boolean

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

message
String String 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.

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

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

public static void AreNotEqual (string notExpected, string actual, bool ignoreCase, System.Globalization.CultureInfo culture, string message);
static member AreNotEqual : string * string * bool * System.Globalization.CultureInfo * string -> unit
Public Shared Sub AreNotEqual (notExpected As String, actual As String, ignoreCase As Boolean, culture As CultureInfo, message As String)

Parameters

notExpected
String String String

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

actual
String String String

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

ignoreCase
Boolean Boolean Boolean

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

culture
CultureInfo CultureInfo CultureInfo

A CultureInfo object that supplies culture-specific comparison information.

message
String String 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.

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

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

public static void AreNotEqual (float notExpected, float actual, float delta, string message, params object[] parameters);
static member AreNotEqual : single * single * single * string * obj[] -> unit
Public Shared Sub AreNotEqual (notExpected As Single, actual As Single, delta As Single, message As String, ParamArray parameters As Object())

Parameters

notExpected
Single Single Single

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

actual
Single Single Single

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

delta
Single Single Single

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

message
String String 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.

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

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

public static void AreNotEqual (double notExpected, double actual, double delta, string message, params object[] parameters);
static member AreNotEqual : double * double * double * string * obj[] -> unit
Public Shared Sub AreNotEqual (notExpected As Double, actual As Double, delta As Double, message As String, ParamArray parameters As Object())

Parameters

notExpected
Double Double Double

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

actual
Double Double Double

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

delta
Double Double Double

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

message
String String 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.

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

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

public static void AreNotEqual (string notExpected, string actual, bool ignoreCase, System.Globalization.CultureInfo culture);
static member AreNotEqual : string * string * bool * System.Globalization.CultureInfo -> unit
Public Shared Sub AreNotEqual (notExpected As String, actual As String, ignoreCase As Boolean, culture As CultureInfo)

Parameters

notExpected
String String String

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

actual
String String String

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

ignoreCase
Boolean Boolean Boolean

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

culture
CultureInfo CultureInfo CultureInfo

A CultureInfo object that supplies culture-specific comparison information.

Exceptions

Thrown if notExpected is equal to actual.

AreNotEqual(Object, Object) AreNotEqual(Object, Object) 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.

public static void AreNotEqual (object notExpected, object actual);
static member AreNotEqual : obj * obj -> unit
Public Shared Sub AreNotEqual (notExpected As Object, actual As Object)

Parameters

notExpected
Object Object Object

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

actual
Object Object Object

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

Exceptions

Thrown if notExpected is equal to actual.

AreNotEqual(Object, Object, String, Object[]) AreNotEqual(Object, Object, String, Object[]) 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.

public static void AreNotEqual (object notExpected, object actual, string message, params object[] parameters);
static member AreNotEqual : obj * obj * string * obj[] -> unit
Public Shared Sub AreNotEqual (notExpected As Object, actual As Object, message As String, ParamArray parameters As Object())

Parameters

notExpected
Object Object Object

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

actual
Object Object Object

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

message
String String 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.

AreNotEqual(Double, Double, Double, String) AreNotEqual(Double, Double, Double, String) AreNotEqual(Double, Double, Double, String)

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

public static void AreNotEqual (double notExpected, double actual, double delta, string message);
static member AreNotEqual : double * double * double * string -> unit
Public Shared Sub AreNotEqual (notExpected As Double, actual As Double, delta As Double, message As String)

Parameters

notExpected
Double Double Double

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

actual
Double Double Double

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

delta
Double Double Double

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

message
String String 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.

AreNotEqual(String, String, Boolean) AreNotEqual(String, String, Boolean) 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.

public static void AreNotEqual (string notExpected, string actual, bool ignoreCase);
static member AreNotEqual : string * string * bool -> unit
Public Shared Sub AreNotEqual (notExpected As String, actual As String, ignoreCase As Boolean)

Parameters

notExpected
String String String

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

actual
String String String

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

ignoreCase
Boolean Boolean Boolean

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

Exceptions

Thrown if notExpected is equal to actual.

AreNotEqual(Single, Single, Single) AreNotEqual(Single, Single, Single) AreNotEqual(Single, Single, Single)

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

public static void AreNotEqual (float notExpected, float actual, float delta);
static member AreNotEqual : single * single * single -> unit
Public Shared Sub AreNotEqual (notExpected As Single, actual As Single, delta As Single)

Parameters

notExpected
Single Single Single

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

actual
Single Single Single

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

delta
Single Single 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.

AreNotEqual(Object, Object, String) AreNotEqual(Object, Object, String) 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.

public static void AreNotEqual (object notExpected, object actual, string message);
static member AreNotEqual : obj * obj * string -> unit
Public Shared Sub AreNotEqual (notExpected As Object, actual As Object, message As String)

Parameters

notExpected
Object Object Object

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

actual
Object Object Object

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

message
String String 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.

AreNotEqual(Double, Double, Double) AreNotEqual(Double, Double, Double) AreNotEqual(Double, Double, Double)

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

public static void AreNotEqual (double notExpected, double actual, double delta);
static member AreNotEqual : double * double * double -> unit
Public Shared Sub AreNotEqual (notExpected As Double, actual As Double, delta As Double)

Parameters

notExpected
Double Double Double

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

actual
Double Double Double

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

delta
Double Double 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.

AreNotEqual(Single, Single, Single, String) AreNotEqual(Single, Single, Single, String) AreNotEqual(Single, Single, Single, String)

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

public static void AreNotEqual (float notExpected, float actual, float delta, string message);
static member AreNotEqual : single * single * single * string -> unit
Public Shared Sub AreNotEqual (notExpected As Single, actual As Single, delta As Single, message As String)

Parameters

notExpected
Single Single Single

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

actual
Single Single Single

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

delta
Single Single Single

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

message
String String 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.

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

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

public static void AreNotEqual<T> (T notExpected, T actual, string message, params object[] parameters);
static member AreNotEqual : 'T * 'T * string * obj[] -> unit
Public Shared Sub AreNotEqual(Of T) (notExpected As T, actual As T, message As String, ParamArray parameters As Object())

Type Parameters

T

The type of values to compare.

Parameters

notExpected
T T T

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

actual
T T T

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

message
String String 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.

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

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

public static void AreNotEqual<T> (T notExpected, T actual);
static member AreNotEqual : 'T * 'T -> unit
Public Shared Sub AreNotEqual(Of T) (notExpected As T, actual As T)

Type Parameters

T

The type of values to compare.

Parameters

notExpected
T T T

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

actual
T T T

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

Exceptions

Thrown if notExpected is equal to actual.

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

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

public static void AreNotEqual<T> (T notExpected, T actual, string message);
static member AreNotEqual : 'T * 'T * string -> unit
Public Shared Sub AreNotEqual(Of T) (notExpected As T, actual As T, message As String)

Type Parameters

T

The type of values to compare.

Parameters

notExpected
T T T

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

actual
T T T

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

message
String String 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