Refactored emulator unittest