Search in sources :

Example 11 with Team

use of net.johnpwood.android.standuptimer.model.Team 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 12 with Team

use of net.johnpwood.android.standuptimer.model.Team 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)

Example 13 with Team

use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.

the class TeamDAOTest method test_cannot_create_a_team_with_an_empty_name.

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

Example 14 with Team

use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.

the class TeamDAOTest method test_find_a_team_by_id.

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

Example 15 with Team

use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.

the class TeamDAOTest method test_find_by_team_returns_null_if_team_cannot_be_found.

@MediumTest
public void test_find_by_team_returns_null_if_team_cannot_be_found() {
    Team team = dao.findByName("Blah Blah Blah");
    assertNull(team);
}
Also used : Team(net.johnpwood.android.standuptimer.model.Team) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Aggregations

Team (net.johnpwood.android.standuptimer.model.Team)37 MediumTest (android.test.suitebuilder.annotation.MediumTest)28 Meeting (net.johnpwood.android.standuptimer.model.Meeting)17 GregorianCalendar (java.util.GregorianCalendar)16 Date (java.util.Date)3 ContentValues (android.content.ContentValues)2 Context (android.content.Context)2 Cursor (android.database.Cursor)2 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)2 RenamingDelegatingContext (android.test.RenamingDelegatingContext)2 MeetingDAO (net.johnpwood.android.standuptimer.dao.MeetingDAO)2 TeamDAO (net.johnpwood.android.standuptimer.dao.TeamDAO)2 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 CannotUpdateMeetingException (net.johnpwood.android.standuptimer.dao.CannotUpdateMeetingException)1 DuplicateTeamException (net.johnpwood.android.standuptimer.dao.DuplicateTeamException)1 InvalidTeamNameException (net.johnpwood.android.standuptimer.dao.InvalidTeamNameException)1 MeetingStats (net.johnpwood.android.standuptimer.model.MeetingStats)1