Example #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;
 }
Example #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);
    }
  }
Example #3
0
 private void checkSimpleWorkout(Workout w, int i) {
   assertEquals("Workout " + i, w.getName());
   assertEquals(i, w.getRepeatCount());
   assertEquals(i % 2 == 0, w.isWarmUp());
 }