Assert.NotNull Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
NotNull(Object, String, Object[]) |
Verifies that the object that is passed in is not equal to |
NotNull(Object) |
Verifies that the object that is passed in is not equal to |
NotNull(Object, String) |
Verifies that the object that is passed in is not equal to |
NotNull(Object, String, Object[])
Verifies that the object that is passed in is not equal to null
If the object is null
then an AssertionException
is thrown.
public static void NotNull (object anObject, string message, params object[] args);
static member NotNull : obj * string * obj[] -> unit
Parameters
- anObject
- Object
The object that is to be tested
- message
- String
The message to be displayed when the object is null
- args
- Object[]
Arguments to be used in formatting the message
Applies to
NotNull(Object)
Verifies that the object that is passed in is not equal to null
If the object is null
then an AssertionException
is thrown.
public static void NotNull (object anObject);
static member NotNull : obj -> unit
Parameters
- anObject
- Object
The object that is to be tested
Applies to
NotNull(Object, String)
Verifies that the object that is passed in is not equal to null
If the object is null
then an AssertionException
is thrown.
public static void NotNull (object anObject, string message);
static member NotNull : obj * string -> unit
Parameters
- anObject
- Object
The object that is to be tested
- message
- String
The message to be displayed when the object is null