use of net.johnpwood.android.standuptimer.model.Meeting 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.Meeting 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());
}
use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class TeamTest method test_has_meetings.
@MediumTest
public void test_has_meetings() {
Team team = Team.create("Test Team No Meetings", mContext);
assertFalse(team.hasMeetings(mContext));
new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 301, 343, 30, 65).save(mContext);
assertTrue(team.hasMeetings(mContext));
}
use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class MeetingDAO method findAllByTeam.
public List<Meeting> findAllByTeam(Team team) {
List<Meeting> meetings = new ArrayList<Meeting>();
Cursor cursor = null;
try {
SQLiteDatabase db = getReadableDatabase();
cursor = db.query(MEETINGS_TABLE_NAME, MEETINGS_ALL_COLUMS, MEETINGS_TEAM_NAME + " = ?", new String[] { team.getName() }, null, null, MEETINGS_MEETING_TIME);
while (cursor.moveToNext()) {
meetings.add(createMeetingFromCursorData(cursor));
}
} finally {
closeCursor(cursor);
}
Logger.d("Found " + meetings.size() + " meetings");
Collections.reverse(meetings);
return meetings;
}
use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class MeetingDAO method createNewMeeting.
private Meeting createNewMeeting(SQLiteDatabase db, Meeting meeting) {
Logger.d("Creating new meeting for " + meeting.getTeam().getName() + " with a date/time of '" + meeting.getDateTime() + "'");
ContentValues values = createContentValues(meeting);
long id = db.insertOrThrow(MEETINGS_TABLE_NAME, null, values);
return new Meeting(id, meeting);
}
Aggregations