add unit tests for NilClass