use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class MeetingDAOTest method test_cannot_update_a_meeting_that_has_already_been_created.
@MediumTest
public void test_cannot_update_a_meeting_that_has_already_been_created() {
Meeting meeting = new Meeting(new Team("Test Team"), new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120);
meeting = dao.save(meeting);
try {
dao.save(meeting);
fail("Should have thrown an exception");
} catch (CannotUpdateMeetingException e) {
assertTrue(true);
}
}
use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class MeetingTest method test_delete_all_by_team.
@MediumTest
public void test_delete_all_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);
;
assertFalse(Meeting.findAllByTeam(team, mContext).isEmpty());
Meeting.deleteAllByTeam(team, mContext);
assertTrue(Meeting.findAllByTeam(team, mContext).isEmpty());
}
use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class MeetingTest method test_save_a_meeting.
@MediumTest
public void test_save_a_meeting() {
Meeting meeting = new Meeting(new Team("Test Team"), new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120);
meeting = meeting.save(mContext);
assertNotNull(meeting.getId());
}
use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class TeamDetails method deleteMeeting.
private void deleteMeeting(String dateString) {
try {
Date date = new SimpleDateFormat(Meeting.DESCRIPTION_FORMAT).parse(dateString);
Meeting meeting = Meeting.findByTeamAndDate(team, date, this);
meeting.delete(this);
} catch (ParseException e) {
Logger.e(e.getMessage());
Logger.e("Could not parse the date string '" + dateString + "'. Will not attempt to delete the meeting.");
}
}
use of net.johnpwood.android.standuptimer.model.Meeting 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);
}
Aggregations