Share via


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

Verifies that two specified generic type data are not equal. The assertion fails if they are equal.

Namespace:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

Syntax

'Declaration
Public Shared Sub AreNotEqual(Of T) ( _
    notExpected As T, _
    actual As T _
)
public static void AreNotEqual<T>(
    T notExpected,
    T actual
)
public:
generic<typename T>
static void AreNotEqual(
    T notExpected, 
    T actual
)
static member AreNotEqual : 
        notExpected:'T * 
        actual:'T -> unit 
JScript does not support generic types or methods.

Type Parameters

  • T

Parameters

  • notExpected
    Type: T
    The first generic type data to compare. This is the generic type data the unit test expects not to match actual.
  • actual
    Type: T
    The second generic type data to compare. This is the generic type data the unit test produced.

Exceptions

Exception Condition
AssertFailedException

notExpected is equal to actual.

Remarks

Different numeric types are treated as equal if the logical values are equal. For example, 42L is equal to 42.

T is the type of values to compare.

.NET Framework Security

See Also

Reference

Assert Class

AreNotEqual Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace

Other Resources

Using the Assert Classes