PexAssert.IsNotNull Method

Definition

Overloads

IsNotNull(Object)

Asserts that the object reference is not null.

IsNotNull(Object, String)

Asserts that the object reference is not null with a specified message in the exception object.

IsNotNull(Object, String, Object[])

Asserts that the object reference is not null with a specified message in the exception object.

IsNotNull(Object)

Asserts that the object reference is not null.

C++
public:
 static void IsNotNull(System::Object ^ value);

Parameters

value
Object

An object.

Exceptions

If the object reference is null.

Applies to

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

IsNotNull(Object, String)

Asserts that the object reference is not null with a specified message in the exception object.

C++
public:
 static void IsNotNull(System::Object ^ value, System::String ^ message);

Parameters

value
Object

An object.

message
String

A message string.

Exceptions

If the object reference is null.

Applies to

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

IsNotNull(Object, String, Object[])

Asserts that the object reference is not null with a specified message in the exception object.

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

Parameters

value
Object

An object.

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 object reference is null.

Applies to

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