Assert.That Property


Gets the singleton instance of the Assert functionality.

public static Microsoft.VisualStudio.TestTools.UnitTesting.Assert That { get; }
member this.That : Microsoft.VisualStudio.TestTools.UnitTesting.Assert
Public Shared ReadOnly Property That As Assert

Property Value


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 "".

Applies to