Search in sources :

Example 21 with Meeting

use of net.johnpwood.android.standuptimer.model.Meeting 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));
}
Also used : Context(android.content.Context) RenamingDelegatingContext(android.test.RenamingDelegatingContext) RenamingDelegatingContext(android.test.RenamingDelegatingContext) Meeting(net.johnpwood.android.standuptimer.model.Meeting) GregorianCalendar(java.util.GregorianCalendar) Team(net.johnpwood.android.standuptimer.model.Team) TeamDAO(net.johnpwood.android.standuptimer.dao.TeamDAO) MeetingDAO(net.johnpwood.android.standuptimer.dao.MeetingDAO)

Example 22 with Meeting

use of net.johnpwood.android.standuptimer.model.Meeting 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());
}
Also used : Meeting(net.johnpwood.android.standuptimer.model.Meeting) GregorianCalendar(java.util.GregorianCalendar) Team(net.johnpwood.android.standuptimer.model.Team) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 23 with Meeting

use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.

the class MeetingDAOTest method test_create_a_meeting.

@MediumTest
public void test_create_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 = dao.save(meeting);
    assertNotNull(meeting.getId());
    meeting = dao.findById(meeting.getId());
    assertEquals("Test Team", meeting.getTeam().getName());
    assertEquals(new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), meeting.getDateTime());
    assertEquals(5f, meeting.getMeetingStats().getNumParticipants());
    assertEquals(240.f, meeting.getMeetingStats().getIndividualStatusLength());
    assertEquals(300f, meeting.getMeetingStats().getMeetingLength());
    assertEquals(30f, meeting.getMeetingStats().getQuickestStatus());
    assertEquals(120f, meeting.getMeetingStats().getLongestStatus());
}
Also used : Meeting(net.johnpwood.android.standuptimer.model.Meeting) GregorianCalendar(java.util.GregorianCalendar) Team(net.johnpwood.android.standuptimer.model.Team) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 24 with Meeting

use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.

the class MeetingDetailsTest 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, 0, 5, 10, 15, 0).getTime(), 5, 301, 343, 30, 65));
    meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 0, 6, 10, 17, 0).getTime(), 8, 534, 550, 32, 120));
    meetingToDelete = meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 0, 7, 10, 16, 0).getTime(), 2, 234, 300, 23, 122));
    meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 0, 8, 10, 14, 0).getTime(), 3, 765, 765, 15, 78));
    meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 0, 9, 10, 12, 0).getTime(), 9, 444, 445, 10, 93));
}
Also used : Context(android.content.Context) RenamingDelegatingContext(android.test.RenamingDelegatingContext) RenamingDelegatingContext(android.test.RenamingDelegatingContext) Meeting(net.johnpwood.android.standuptimer.model.Meeting) GregorianCalendar(java.util.GregorianCalendar) Team(net.johnpwood.android.standuptimer.model.Team) TeamDAO(net.johnpwood.android.standuptimer.dao.TeamDAO) MeetingDAO(net.johnpwood.android.standuptimer.dao.MeetingDAO)

Aggregations

Meeting (net.johnpwood.android.standuptimer.model.Meeting)24 Team (net.johnpwood.android.standuptimer.model.Team)17 GregorianCalendar (java.util.GregorianCalendar)16 MediumTest (android.test.suitebuilder.annotation.MediumTest)14 Date (java.util.Date)5 Cursor (android.database.Cursor)3 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)3 Context (android.content.Context)2 RenamingDelegatingContext (android.test.RenamingDelegatingContext)2 ArrayList (java.util.ArrayList)2 MeetingDAO (net.johnpwood.android.standuptimer.dao.MeetingDAO)2 TeamDAO (net.johnpwood.android.standuptimer.dao.TeamDAO)2 ContentValues (android.content.ContentValues)1 ArrayAdapter (android.widget.ArrayAdapter)1 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 CannotUpdateMeetingException (net.johnpwood.android.standuptimer.dao.CannotUpdateMeetingException)1 MeetingStats (net.johnpwood.android.standuptimer.model.MeetingStats)1