次の方法で共有


Assert.IsNull Method

Definition

Overloads

IsNull(Object)

Tests whether the specified object is null and throws an exception if it is not.

IsNull(Object, String)

Tests whether the specified object is null and throws an exception if it is not.

IsNull(Object, String, Object[])

Tests whether the specified object is null and throws an exception if it is not.

IsNull(Object)

Tests whether the specified object is null and throws an exception if it is not.

public:
 static void IsNull(System::Object ^ value);
public static void IsNull (object value);
static member IsNull : obj -> unit
Public Shared Sub IsNull (value As Object)

Parameters

value
Object

The object the test expects to be null.

Exceptions

Thrown if value is not null.

Applies to

IsNull(Object, String)

Tests whether the specified object is null and throws an exception if it is not.

public:
 static void IsNull(System::Object ^ value, System::String ^ message);
public static void IsNull (object value, string message);
static member IsNull : obj * string -> unit
Public Shared Sub IsNull (value As Object, message As String)

Parameters

value
Object

The object the test expects to be null.

message
String

The message to include in the exception when value is not null. The message is shown in test results.

Exceptions

Thrown if value is not null.

Applies to

IsNull(Object, String, Object[])

Tests whether the specified object is null and throws an exception if it is not.

public:
 static void IsNull(System::Object ^ value, System::String ^ message, ... cli::array <System::Object ^> ^ parameters);
public static void IsNull (object value, string message, params object[] parameters);
static member IsNull : obj * string * obj[] -> unit
Public Shared Sub IsNull (value As Object, message As String, ParamArray parameters As Object())

Parameters

value
Object

The object the test expects to be null.

message
String

The message to include in the exception when value is not null. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if value is not null.

Applies to