PexAssert.IsTrue Method

Definition

Overloads

IsTrue(Boolean)

Asserts that the condition evaluates to true.

IsTrue(Boolean, String)

Asserts that the condition evaluates to true, with a specified message and format in the exception object.

IsTrue(Boolean, String, Object[])

Asserts that the condition evaluates to true, with a specified message in the exception object.

IsTrue(Boolean)

Asserts that the condition evaluates to true.

C++
public:
 static void IsTrue(bool condition);

Parameters

condition
Boolean

A Boolean condition.

Exceptions

If the condition evaluates to false.

Applies to

Visual Studio SDK 2019 et Visual Studio SDK 2017
Produit Versions
Visual Studio SDK 2017, 2019

IsTrue(Boolean, String)

Asserts that the condition evaluates to true, with a specified message and format in the exception object.

C++
public:
 static void IsTrue(bool condition, System::String ^ message);

Parameters

condition
Boolean

A Boolean condition.

message
String

The message string.

Exceptions

If the condition evaluates to false.

Applies to

Visual Studio SDK 2019 et Visual Studio SDK 2017
Produit Versions
Visual Studio SDK 2017, 2019

IsTrue(Boolean, String, Object[])

Asserts that the condition evaluates to true, with a specified message in the exception object.

C++
public:
 static void IsTrue(bool condition, System::String ^ format, ... cli::array <System::Object ^> ^ args);

Parameters

condition
Boolean

A Boolean condition.

format
String

A message format string. The syntax for this string is identical to the format string used by Console.Writeline. In particular, insert "{0}", "{1}" and so on at appropriate locations in the string to represent the values of the variables in the args array.

args
Object[]

One or more variables. whose values are to be inserted in format.

Exceptions

If the condition evaluates to false.

Applies to

Visual Studio SDK 2019 et Visual Studio SDK 2017
Produit Versions
Visual Studio SDK 2017, 2019