Search in sources :

Example 1 with DuplicateTeamException

use of net.johnpwood.android.standuptimer.dao.DuplicateTeamException in project standup-timer by jwood.

the class TeamDAOTest method test_cannot_create_a_team_with_a_name_that_already_exists.

@MediumTest
public void test_cannot_create_a_team_with_a_name_that_already_exists() {
    dao.save(new Team("Test Team 1"));
    try {
        dao.save(new Team("Test Team 1"));
        assertTrue("Should have thrown an exception", false);
    } catch (DuplicateTeamException e) {
        assertTrue(true);
    }
}
Also used : Team(net.johnpwood.android.standuptimer.model.Team) DuplicateTeamException(net.johnpwood.android.standuptimer.dao.DuplicateTeamException) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Aggregations

MediumTest (android.test.suitebuilder.annotation.MediumTest)1 DuplicateTeamException (net.johnpwood.android.standuptimer.dao.DuplicateTeamException)1 Team (net.johnpwood.android.standuptimer.model.Team)1