use of net.johnpwood.android.standuptimer.model.Team 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.Team in project standup-timer by jwood.
the class TeamDAO method createNewTeam.
private Team createNewTeam(SQLiteDatabase db, Team team) {
if (team.getName() == null || team.getName().trim().length() == 0) {
String msg = "Attempting to create a team with an empty name";
Logger.w(msg);
throw new InvalidTeamNameException(msg);
}
if (attemptingToCreateDuplicateTeam(team)) {
String msg = "Attempting to create duplicate team with the name " + team.getName();
Logger.w(msg);
throw new DuplicateTeamException(msg);
}
Logger.d("Creating new team with a name of '" + team.getName() + "'");
ContentValues values = new ContentValues();
values.put(TEAMS_NAME, team.getName());
long id = db.insertOrThrow(TEAMS_TABLE_NAME, null, values);
return new Team(id, team.getName());
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class StandupTimerTest method test_meeting_stats_are_stored_when_finish_is_clicked.
@MediumTest
public void test_meeting_stats_are_stored_when_finish_is_clicked() {
a.setMeetingStartTime(System.currentTimeMillis());
a.setCompletedParticipants(5);
a.setIndividualStatusEndTime(System.currentTimeMillis());
a.setQuickestStatus(60);
a.setLongestStatus(120);
a.setTeam(new Team("Test team"));
clickFinishedButton();
assertTrue(a.wasPersistMeetingCalled());
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class TeamDetailsTest method createTestData.
private void createTestData() {
Context context = new RenamingDelegatingContext(getInstrumentation().getTargetContext(), "test_");
TeamDAO teamFixturesDao = daoFactory.getTeamDAO(context);
MeetingDAO meetingFixturesDao = daoFactory.getMeetingDAO(context);
Team team = teamFixturesDao.save(new Team("Test Team"));
meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 301, 343, 30, 65));
meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 1, 6, 10, 17, 0).getTime(), 8, 534, 550, 32, 120));
meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 1, 7, 10, 16, 0).getTime(), 2, 234, 300, 23, 122));
meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 1, 8, 10, 14, 0).getTime(), 3, 765, 765, 15, 78));
meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 1, 9, 10, 12, 0).getTime(), 9, 444, 445, 10, 93));
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class MeetingDAOTest method test_find_by_team_and_date.
@MediumTest
public void test_find_by_team_and_date() {
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));
Meeting expected = 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));
Meeting actual = dao.findByTeamAndDate(team, new GregorianCalendar(2010, 1, 7, 10, 15, 0).getTime());
assertEquals(expected.getId(), actual.getId());
}
Aggregations