Add missing tests for assertInternalType() and assertNotInternalType()
Refactor assertInternalType() and assertNotInternalType()