Assert.Fail Method (String)
Fails the assertion without checking any conditions. Displays a message.
Namespace: Microsoft.VisualStudio.TestTools.UnitTesting
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
Syntax
'Declaration
Public Shared Sub Fail ( _
message As String _
)
public static void Fail(
string message
)
public:
static void Fail(
String^ message
)
static member Fail :
message:string -> unit
public static function Fail(
message : String
)
Parameters
message
Type: StringA message to display. This message can be seen in the unit test results.
Exceptions
Exception | Condition |
---|---|
AssertFailedException | Always thrown. |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualStudio.TestTools.UnitTesting Namespace