This topic has not yet been rated - Rate this topic

Assert.IsTrue Method (Boolean, String)

Verifies that the specified condition is true. The assertion fails if the condition is false. Displays a message if the assertion fails.

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

public static void IsTrue (
	bool condition,
	string message
)
public static void IsTrue (
	boolean condition, 
	String message
)
public static function IsTrue (
	condition : boolean, 
	message : String
)

Parameters

condition

The condition to verify is true.

message

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

Exception type Condition

AssertFailedException

condition evaluates to false.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ