예제 #1
0
 private Workout prepareWorkout(int number) {
   Workout workout = new Workout();
   workout.setName("Workout " + number);
   workout.setRepeatCount(number);
   workout.setWarmUp(number % 2 == 0);
   workout.setActions(prepareActions(number));
   return workout;
 }
예제 #2
0
  public void testGetWholeSingleWorkout() {
    final int TESTS_NUMBER_ITEMS = 20;
    insertWorkouts(TESTS_NUMBER_ITEMS);

    List<Workout> workouts = db.getAllWorkoutNames();

    for (Workout workout : workouts) {
      Workout w = db.getWholeSingleWorkout(workout.getID());
      int creationI = w.getRepeatCount(); // repeat count points the
      // creation i number
      checkSimpleWorkout(w, creationI);
      checkActions(w.getActions(), creationI);
    }
  }
예제 #3
0
 private void checkSimpleWorkout(Workout w, int i) {
   assertEquals("Workout " + i, w.getName());
   assertEquals(i, w.getRepeatCount());
   assertEquals(i % 2 == 0, w.isWarmUp());
 }