Share via


Assert.That Property

Definition

Caution

The 'That' property is obsolete and will be removed in a future version. Use the 'Instance' property instead.

Gets the singleton instance of the Assert functionality.

public static Microsoft.VisualStudio.TestTools.UnitTesting.Assert That { get; }
[System.Obsolete("The 'That' property is obsolete and will be removed in a future version. Use the 'Instance' property instead.")]
public static Microsoft.VisualStudio.TestTools.UnitTesting.Assert That { get; }
static member That : Microsoft.VisualStudio.TestTools.UnitTesting.Assert
[<System.Obsolete("The 'That' property is obsolete and will be removed in a future version. Use the 'Instance' property instead.")>]
static member That : Microsoft.VisualStudio.TestTools.UnitTesting.Assert
Public Shared ReadOnly Property That As Assert

Property Value

Attributes

Remarks

Users can use this to plug-in custom assertions through C# extension methods. For instance, the signature of a custom assertion provider could be "public static void IsOfType<T>(this Assert assert, object obj)" Users could then use a syntax similar to the default assertions which in this case is "Assert.That.IsOfType<Dog>(animal);" More documentation is at "https://github.com/Microsoft/testfx/docs/README.md".

Applies to