Add assert_null and assert_not_null method

There are too many atributes are initialized to null in spec. Use these
two new functions can optimize the code in test case.