Search in sources :

Example 16 with Team

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

the class TeamDAOTest method test_can_update_an_existing_team.

@MediumTest
public void test_can_update_an_existing_team() {
    Team team1 = dao.save(new Team("Test Team 1"));
    dao.save(new Team(team1.getId(), "Test Team 2"));
    Team team = dao.findById(team1.getId());
    assertEquals("Test Team 2", team.getName());
}
Also used : Team(net.johnpwood.android.standuptimer.model.Team) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 17 with Team

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

the class TeamDAOTest method test_create_a_team_with_an_apostrophy_in_the_name.

@MediumTest
public void test_create_a_team_with_an_apostrophy_in_the_name() {
    Team team = new Team("John's Team");
    team = dao.save(team);
    assertNotNull(team.getId());
    assertEquals("John's Team", team.getName());
}
Also used : Team(net.johnpwood.android.standuptimer.model.Team) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 18 with Team

use of net.johnpwood.android.standuptimer.model.Team 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());
}
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 19 with Team

use of net.johnpwood.android.standuptimer.model.Team 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());
}
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 20 with Team

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

the class TeamList method deleteTeam.

private void deleteTeam(String teamName) {
    Team team = Team.findByName(teamName, this);
    team.delete(this);
}
Also used : Team(net.johnpwood.android.standuptimer.model.Team)

Aggregations

Team (net.johnpwood.android.standuptimer.model.Team)37 MediumTest (android.test.suitebuilder.annotation.MediumTest)28 Meeting (net.johnpwood.android.standuptimer.model.Meeting)17 GregorianCalendar (java.util.GregorianCalendar)16 Date (java.util.Date)3 ContentValues (android.content.ContentValues)2 Context (android.content.Context)2 Cursor (android.database.Cursor)2 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)2 RenamingDelegatingContext (android.test.RenamingDelegatingContext)2 MeetingDAO (net.johnpwood.android.standuptimer.dao.MeetingDAO)2 TeamDAO (net.johnpwood.android.standuptimer.dao.TeamDAO)2 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 CannotUpdateMeetingException (net.johnpwood.android.standuptimer.dao.CannotUpdateMeetingException)1 DuplicateTeamException (net.johnpwood.android.standuptimer.dao.DuplicateTeamException)1 InvalidTeamNameException (net.johnpwood.android.standuptimer.dao.InvalidTeamNameException)1 MeetingStats (net.johnpwood.android.standuptimer.model.MeetingStats)1