Search in sources :

Example 81 with MediumTest

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

the class ConfigureStandupTimerTest method test_less_than_1_meeting_participants_displays_error_dialog.

@MediumTest
public void test_less_than_1_meeting_participants_displays_error_dialog() {
    TextView t = (TextView) a.findViewById(R.id.num_participants);
    t.setText("0");
    Button b = (Button) a.findViewById(R.id.start_button);
    b.performClick();
    assertTrue(a.showInvalidNumberOfParticipantsDialogCalled());
    assertFalse(a.startTimerCalled());
}
Also used : Button(android.widget.Button) TextView(android.widget.TextView) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 82 with MediumTest

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

the class ConfigureStandupTimerTest method test_specifying_an_invalid_number_of_participants_shouldnt_crash_the_app.

@MediumTest
public void test_specifying_an_invalid_number_of_participants_shouldnt_crash_the_app() {
    Prefs.setAllowUnlimitedParticipants(a, true);
    TextView t = (TextView) a.findViewById(R.id.num_participants);
    t.setText("2198723498239487239487234987");
    Button b = (Button) a.findViewById(R.id.start_button);
    b.performClick();
    assertFalse(a.showInvalidNumberOfParticipantsDialogCalled());
    assertTrue(a.startTimerCalled());
}
Also used : Button(android.widget.Button) TextView(android.widget.TextView) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 83 with MediumTest

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

the class MeetingDAOTest method test_cannot_update_a_meeting_that_has_already_been_created.

@MediumTest
public void test_cannot_update_a_meeting_that_has_already_been_created() {
    Meeting meeting = new Meeting(new Team("Test Team"), new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120);
    meeting = dao.save(meeting);
    try {
        dao.save(meeting);
        fail("Should have thrown an exception");
    } catch (CannotUpdateMeetingException e) {
        assertTrue(true);
    }
}
Also used : Meeting(net.johnpwood.android.standuptimer.model.Meeting) GregorianCalendar(java.util.GregorianCalendar) Team(net.johnpwood.android.standuptimer.model.Team) CannotUpdateMeetingException(net.johnpwood.android.standuptimer.dao.CannotUpdateMeetingException) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 84 with MediumTest

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

the class TeamDAOTest method test_create_a_team.

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

Example 85 with MediumTest

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

the class TeamDAOTest method test_find_all_can_retrieve_all_teams.

@MediumTest
public void test_find_all_can_retrieve_all_teams() {
    dao.save(new Team("Test Team 1"));
    dao.save(new Team("Test Team 2"));
    dao.save(new Team("Test Team 3"));
    dao.save(new Team("Test Team 4"));
    List<String> teams = dao.findAllTeamNames();
    assertEquals(4, teams.size());
}
Also used : Team(net.johnpwood.android.standuptimer.model.Team) 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