use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class TeamDAOTest method test_can_find_a_team_by_name.
@MediumTest
public void test_can_find_a_team_by_name() {
dao.save(new Team("Test Team 1"));
Team team = dao.findByName("Test Team 1");
assertEquals("Test Team 1", team.getName());
assertNotNull(team.getId());
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class MeetingTest method test_find_all_meetings_by_team.
@MediumTest
public void test_find_all_meetings_by_team() {
Team team = new Team("Test Team");
new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
new Meeting(team, new GregorianCalendar(2010, 1, 4, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
;
new Meeting(team, new GregorianCalendar(2010, 1, 7, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
;
new Meeting(team, new GregorianCalendar(2010, 1, 1, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
;
new Meeting(team, new GregorianCalendar(2010, 1, 2, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
;
List<Meeting> meetings = Meeting.findAllByTeam(team, mContext);
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 MeetingTest method test_find_by_team_and_date.
@MediumTest
public void test_find_by_team_and_date() {
Team team = new Team("Test Team");
new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
new Meeting(team, new GregorianCalendar(2010, 1, 4, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
;
Meeting expected = new Meeting(team, new GregorianCalendar(2010, 1, 7, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
;
new Meeting(team, new GregorianCalendar(2010, 1, 1, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
;
new Meeting(team, new GregorianCalendar(2010, 1, 2, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
;
Meeting actual = Meeting.findByTeamAndDate(team, new GregorianCalendar(2010, 1, 7, 10, 15, 0).getTime(), mContext);
assertEquals(expected.getId(), actual.getId());
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class TeamTest method test_delete_a_team.
@MediumTest
public void test_delete_a_team() {
Team team = Team.create("Test Team", mContext);
assertEquals(1, Team.findAllTeamNames(mContext).size());
team.delete(mContext);
assertEquals(0, Team.findAllTeamNames(mContext).size());
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class TeamTest method test_get_average_meeting_stats.
@MediumTest
public void test_get_average_meeting_stats() {
Team team = Team.create("Test Team", mContext);
Date dateTime = new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime();
new Meeting(team, dateTime, 5, 301, 343, 30, 65).save(mContext);
new Meeting(team, dateTime, 8, 534, 550, 32, 120).save(mContext);
new Meeting(team, dateTime, 2, 234, 300, 23, 122).save(mContext);
new Meeting(team, dateTime, 3, 765, 765, 15, 78).save(mContext);
new Meeting(team, dateTime, 9, 444, 445, 10, 93).save(mContext);
MeetingStats averageStats = team.getAverageMeetingStats(mContext);
assertEquals(5.4f, averageStats.getNumParticipants());
assertEquals(455.6f, averageStats.getIndividualStatusLength());
assertEquals(480.6f, averageStats.getMeetingLength());
assertEquals(22f, averageStats.getQuickestStatus());
assertEquals(95.6f, averageStats.getLongestStatus());
}
Aggregations