use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class MeetingDAO method createMeetingFromCursorData.
private Meeting createMeetingFromCursorData(Cursor cursor) {
long id = cursor.getLong(0);
String teamName = cursor.getString(1);
Date meetingTime = new Date(cursor.getLong(2));
int numParticipants = cursor.getInt(3);
int individualStatusLength = cursor.getInt(4);
int meetingLength = cursor.getInt(5);
int quickestStatus = cursor.getInt(6);
int longestStatus = cursor.getInt(7);
return new Meeting(id, new Team(teamName), meetingTime, numParticipants, individualStatusLength, meetingLength, quickestStatus, longestStatus);
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class MeetingDAOTest method test_delete_all_by_team.
@MediumTest
public void test_delete_all_by_team() {
Team team = new Team("Test Team");
dao.save(new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120));
dao.save(new Meeting(team, new GregorianCalendar(2010, 1, 4, 10, 15, 0).getTime(), 5, 240, 300, 30, 120));
assertFalse(dao.findAllByTeam(team).isEmpty());
dao.deleteAllByTeam(team);
assertTrue(dao.findAllByTeam(team).isEmpty());
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class MeetingDAOTest method test_find_all_meetings_by_team_in_cronological_order.
@MediumTest
public void test_find_all_meetings_by_team_in_cronological_order() {
Team team = new Team("Test Team");
dao.save(new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120));
dao.save(new Meeting(team, new GregorianCalendar(2010, 1, 4, 10, 15, 0).getTime(), 5, 240, 300, 30, 120));
dao.save(new Meeting(team, new GregorianCalendar(2010, 1, 7, 10, 15, 0).getTime(), 5, 240, 300, 30, 120));
dao.save(new Meeting(team, new GregorianCalendar(2010, 1, 1, 10, 15, 0).getTime(), 5, 240, 300, 30, 120));
dao.save(new Meeting(team, new GregorianCalendar(2010, 1, 2, 10, 15, 0).getTime(), 5, 240, 300, 30, 120));
List<Meeting> meetings = dao.findAllByTeam(team);
assertEquals(5, meetings.size());
assertEquals(new GregorianCalendar(2010, 1, 7, 10, 15, 0).getTime(), meetings.get(0).getDateTime());
assertEquals(new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), meetings.get(1).getDateTime());
assertEquals(new GregorianCalendar(2010, 1, 4, 10, 15, 0).getTime(), meetings.get(2).getDateTime());
assertEquals(new GregorianCalendar(2010, 1, 2, 10, 15, 0).getTime(), meetings.get(3).getDateTime());
assertEquals(new GregorianCalendar(2010, 1, 1, 10, 15, 0).getTime(), meetings.get(4).getDateTime());
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class TeamDAOTest method test_can_delete_a_team.
@MediumTest
public void test_can_delete_a_team() {
Team team = dao.save(new Team("Test Team 1"));
assertEquals(1, dao.findAllTeamNames().size());
dao.delete(team);
assertEquals(0, dao.findAllTeamNames().size());
}
use of net.johnpwood.android.standuptimer.model.Team 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);
}
}
Aggregations