This documentation is archived and is not being maintained.

Assert.Fail Method (String, Object[])

Fails the assertion without checking any conditions. Displays a message, and applies the specified formatting to it.

Namespace: Microsoft.VisualStudio.TestTools.UnitTesting
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in microsoft.visualstudio.qualitytools.unittestframework.dll)

public static void Fail (
	string message,
	params Object[] parameters
)
public static void Fail (
	String message, 
	Object[] parameters
)
public static function Fail (
	message : String, 
	... parameters : Object[]
)

Parameters

message

A message to display. This message can be seen in the unit test results.

parameters

An array of parameters to use when formatting message.

Exception typeCondition

AssertFailedException

Always thrown.

Show: