Compartir a través de


PexAssume.IsTrue Method

Definition

Overloads

IsTrue(Boolean, String, Object[])

The test case fails if the condition evaluates to false, with a specified message in the exception object.

IsTrue(Boolean)

The test case fails if the condition evaluates to false.

IsTrue(Boolean, String)

The test case fails if the condition evaluates to false, with a specified message in the exception object.

IsTrue<T>(Boolean, PexAssume.Func<T>)

The test case fails if the condition evaluates to false, otherwise it runs the factory delegate and returns the result.

IsTrue(Boolean, String, Object[])

The test case fails if the condition evaluates to false, with a specified message in the exception object.

public:
 static void IsTrue(bool condition, System::String ^ format, ... cli::array <System::Object ^> ^ args);
public static void IsTrue (bool condition, string format, params object[] args);
static member IsTrue : bool * string * obj[] -> unit
Public Shared Sub IsTrue (condition As Boolean, format As String, ParamArray args As Object())

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 the format string.

Exceptions

If the condition evaluates to false.

Applies to

IsTrue(Boolean)

The test case fails if the condition evaluates to false.

public:
 static void IsTrue(bool condition);
public static void IsTrue (bool condition);
static member IsTrue : bool -> unit
Public Shared Sub IsTrue (condition As Boolean)

Parameters

condition
Boolean

A Boolean condition.

Exceptions

If the condition evaluates to false.

Applies to

IsTrue(Boolean, String)

The test case fails if the condition evaluates to false, with a specified message in the exception object.

public:
 static void IsTrue(bool condition, System::String ^ message);
public static void IsTrue (bool condition, string message);
static member IsTrue : bool * string -> unit
Public Shared Sub IsTrue (condition As Boolean, message As String)

Parameters

condition
Boolean

A Boolean condition.

message
String

A message string.

Exceptions

If the condition evaluates to false.

Applies to

IsTrue<T>(Boolean, PexAssume.Func<T>)

The test case fails if the condition evaluates to false, otherwise it runs the factory delegate and returns the result.

public:
generic <typename T>
 static T IsTrue(bool condition, Microsoft::Pex::Framework::PexAssume::Func<T> ^ factory);
public static T IsTrue<T> (bool condition, Microsoft.Pex.Framework.PexAssume.Func<T> factory);
static member IsTrue : bool * Microsoft.Pex.Framework.PexAssume.Func<'T> -> 'T
Public Shared Function IsTrue(Of T) (condition As Boolean, factory As PexAssume.Func(Of T)) As T

Type Parameters

T

The return type of factory.

Parameters

condition
Boolean

A Boolean condition.

factory
PexAssume.Func<T>

A PexAssume.Func<T> delegate that returns a value of type T

Returns

T

Returns the return value of factory.

Exceptions

If the condition evaluates to false.

Applies to