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 _
)
'Usage
Dim notExpected As T
Dim actual As T

Assert.AreNotEqual(notExpected, actual)
public static void AreNotEqual<T>(
    T notExpected,
    T actual
)
public:
generic<typename T>
static void AreNotEqual(
    T notExpected, 
    T actual
)
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

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

Assert Members

AreNotEqual Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace

Other Resources

Using the Assert Classes