Search in sources :

Example 71 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project standup-timer by jwood.

the class TeamTest method test_create_a_team.

@MediumTest
public void test_create_a_team() {
    Team team = Team.create("Test Team", mContext);
    assertNotNull(team.getId());
}
Also used : Team(net.johnpwood.android.standuptimer.model.Team) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 72 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project standup-timer by jwood.

the class StandupTimerTest method test_individual_status_end_time_is_set_if_finish_is_clicked_early.

@MediumTest
public void test_individual_status_end_time_is_set_if_finish_is_clicked_early() {
    a.setMeetingStartTime(System.currentTimeMillis());
    a.setCompletedParticipants(5);
    a.setQuickestStatus(60);
    a.setLongestStatus(120);
    a.setTeam(new Team("Test team"));
    clickFinishedButton();
    assertTrue(0L != a.getIndividualStatusEndTime());
    assertTrue(a.wasPersistMeetingCalled());
}
Also used : Team(net.johnpwood.android.standuptimer.model.Team) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 73 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project standup-timer by jwood.

the class StandupTimerTest method test_individual_timer_is_disabled_when_there_are_no_more_participants.

@MediumTest
public void test_individual_timer_is_disabled_when_there_are_no_more_participants() throws Throwable {
    a.setCompletedParticipants(4);
    a.setTotalParticipants(5);
    clickNextButton();
    // Test is not executing the thread that updates the UI, so do it manually
    a.disableIndividualTimer();
    assertEquals(0, a.getRemainingIndividualSeconds());
    assertTrue(0L != a.getIndividualStatusEndTime());
    TextView participantNumber = (TextView) a.findViewById(R.id.participant_number);
    assertEquals(a.getString(R.string.individual_status_complete), participantNumber.getText());
    TextView individualTimeRemaining = (TextView) a.findViewById(R.id.individual_time_remaining);
    assertEquals("0:00", individualTimeRemaining.getText());
    assertEquals(Color.GRAY, individualTimeRemaining.getTextColors().getDefaultColor());
    Button nextButton = (Button) a.findViewById(R.id.next_button);
    assertFalse(nextButton.isClickable());
    assertEquals(Color.GRAY, nextButton.getTextColors().getDefaultColor());
}
Also used : Button(android.widget.Button) TextView(android.widget.TextView) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 74 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project standup-timer by jwood.

the class StandupTimerTest method test_total_time_remaining_is_changed_to_yellow_it_reaches_the_warning_time.

@MediumTest
public void test_total_time_remaining_is_changed_to_yellow_it_reaches_the_warning_time() {
    Prefs.setWarningTime(a, 15);
    a.setRemainingMeetingSeconds(16);
    a.updateTimerValues();
    a.updateDisplay();
    TextView totalTimeRemaining = (TextView) a.findViewById(R.id.total_time_remaining);
    assertEquals(Color.YELLOW, totalTimeRemaining.getTextColors().getDefaultColor());
}
Also used : TextView(android.widget.TextView) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 75 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project standup-timer by jwood.

the class StandupTimerTest method test_total_time_remaining_is_changed_to_red_when_time_runs_out.

@MediumTest
public void test_total_time_remaining_is_changed_to_red_when_time_runs_out() {
    a.setRemainingMeetingSeconds(1);
    a.updateTimerValues();
    a.updateDisplay();
    TextView totalTimeRemaining = (TextView) a.findViewById(R.id.total_time_remaining);
    assertEquals(Color.RED, totalTimeRemaining.getTextColors().getDefaultColor());
}
Also used : TextView(android.widget.TextView) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Aggregations

MediumTest (android.test.suitebuilder.annotation.MediumTest)996 View (android.view.View)246 ListView (android.widget.ListView)150 Cursor (android.database.Cursor)116 Handler (android.os.Handler)116 Suppress (android.test.suitebuilder.annotation.Suppress)69 TextView (android.widget.TextView)67 ContentValues (android.content.ContentValues)63 ServiceStatus (com.vodafone360.people.service.ServiceStatus)60 SQLiteCursor (android.database.sqlite.SQLiteCursor)54 SQLiteStatement (android.database.sqlite.SQLiteStatement)49 IOException (java.io.IOException)49 UiThreadTest (android.test.UiThreadTest)48 LogRec (com.android.internal.util.StateMachine.LogRec)42 ContentResolver (android.content.ContentResolver)37 Intent (android.content.Intent)36 Message (android.os.Message)36 GridView (android.widget.GridView)36 InputStream (java.io.InputStream)36 ByteArrayInputStream (java.io.ByteArrayInputStream)35