Code example for KeyEvent

0
        assertEquals(0, a.getLongestStatus());
    } 
 
    @MediumTest 
    public void test_timer_is_stopped_when_back_button_is_pressed() { 
        a.onKeyDown(KeyEvent.KEYCODE_BACK, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));
        a.onPause();
 
        a.loadState();
        assertEquals(DEFAULT_MEETING_LENGTH, a.getRemainingMeetingSeconds());
        assertEquals(DEFAULT_NUM_PARTICIPANTS, a.getTotalParticipants());
        assertTrue(a.isFinished());
    } 
 
    @MediumTest 
    public void test_click_next_button_advances_to_next_participant_and_resets_individual_timer_and_calculates_individual_stats() { 
        a.setLongestStatus(120);
        a.setQuickestStatus(60);
        a.setCurrentIndividualStatusSeconds(75);
        a.setRemainingIndividualSeconds(4);
        assertEquals(0, a.getCompletedParticipants());