use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class MeetingDetails method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.meeting_details);
String teamName = getIntent().getStringExtra("teamName");
String meetingTime = getIntent().getStringExtra("meetingTime");
Logger.i("Looking for meeting for '" + teamName + "' at '" + meetingTime + "'");
Date date = null;
try {
date = new SimpleDateFormat(Meeting.DESCRIPTION_FORMAT).parse(meetingTime);
} catch (ParseException e) {
String msg = "Could not parse the date/time '" + meetingTime + "'. " + e.getMessage();
Logger.e(msg);
throw new RuntimeException(msg);
}
Team team = Team.findByName(teamName, this);
meeting = Meeting.findByTeamAndDate(team, date, this);
displayMeetingStats(team, date);
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class MeetingTest method test_delete_a_meeting.
@MediumTest
public void test_delete_a_meeting() {
Team team = new Team("Test Team");
Meeting meeting = new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120);
meeting = meeting.save(mContext);
assertEquals(1, Meeting.findAllByTeam(team, mContext).size());
meeting.delete(mContext);
assertEquals(0, Meeting.findAllByTeam(team, mContext).size());
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class TeamTest method test_deleting_a_team_deletes_its_meetings_as_well.
@MediumTest
public void test_deleting_a_team_deletes_its_meetings_as_well() {
Team team = Team.create("Test Team", mContext);
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);
;
assertFalse(Meeting.findAllByTeam(team, mContext).isEmpty());
team.delete(mContext);
assertEquals(0, Team.findAllTeamNames(mContext).size());
assertTrue(Meeting.findAllByTeam(team, mContext).isEmpty());
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class TeamTest method test_create_a_team.
@MediumTest
public void test_create_a_team() {
Team team = Team.create("Test Team", mContext);
assertNotNull(team.getId());
}
use of net.johnpwood.android.standuptimer.model.Team in project standup-timer by jwood.
the class StandupTimerTest method test_individual_status_end_time_is_set_if_finish_is_clicked_early.
@MediumTest
public void test_individual_status_end_time_is_set_if_finish_is_clicked_early() {
a.setMeetingStartTime(System.currentTimeMillis());
a.setCompletedParticipants(5);
a.setQuickestStatus(60);
a.setLongestStatus(120);
a.setTeam(new Team("Test team"));
clickFinishedButton();
assertTrue(0L != a.getIndividualStatusEndTime());
assertTrue(a.wasPersistMeetingCalled());
}
Aggregations