Refactor get name tests