assertNull()

Purpose

Checks that an object is not null.

Syntax

assertNull( [<string>,]<object> )

where:

Description

The corresponding test result is Passed if <object> is null, and Failed if the condition is False.

An optional <string> message can be logged and displayed in the test report.

If an exception is thrown in the assertNull() method, the test is stopped.

Examples

Object one_obj = null;

assertNull("assert null passed", one_obj);

 

Object one_obj = null;

assertNull(one_obj);

 

Related Topics

assertNotNull()verifyNotNull() | verifyNull()