Partager via


Assert.Fail Method

Fails the assertion without checking any conditions.

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

Syntax

'Declaration
Public Shared Sub Fail
public static void Fail()
public:
static void Fail()
static member Fail : unit -> unit
public static function Fail()

Exceptions

Exception Condition
AssertFailedException

Always thrown.

.NET Framework Security

See Also

Reference

Assert Class

Fail Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace

Other Resources

Using the Assert Classes