Esempio n. 1
0
  public void testGet() {
    int testSubjects = 11;
    for (int i = 0; i < testSubjects; i++) {
      boolean isOK = db.insertSingleRun(prepareDataSingleRun((i + 3) * 3));
      assertTrue(isOK);
    }

    List<SingleRun> list = db.getAllRuns();
    assertEquals(testSubjects, list.size());
  }
Esempio n. 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);
    }
  }
Esempio n. 3
0
 private void insertWorkouts(int TESTS_NUMBER_ITEMS) {
   boolean isOK = true;
   for (int i = 0; i < TESTS_NUMBER_ITEMS; i++) {
     isOK = isOK && db.insertWorkout(prepareWorkout(i + 1)) != -1;
   }
   assertTrue(isOK);
 }
Esempio n. 4
0
  public void testGetSimpleWorkouts() {
    final int TESTS_NUMBER_ITEMS = 13;
    insertWorkouts(TESTS_NUMBER_ITEMS);

    List<Workout> workouts = db.getAllWorkoutNames();
    assertEquals(TESTS_NUMBER_ITEMS, workouts.size());
    for (int i = 0; i < TESTS_NUMBER_ITEMS; i++) {
      Workout w = workouts.get(i);
      checkSimpleWorkout(w, i + 1);
    }
  }
Esempio n. 5
0
 @Override
 protected void tearDown() throws Exception {
   super.tearDown();
   mContext.deleteDatabase(db.getDBName());
   db = null;
 }
Esempio n. 6
0
 public void testInsertWorkout() {
   boolean isOK = db.insertWorkout(prepareWorkout(13)) != -1;
   assertTrue(isOK);
 }
Esempio n. 7
0
 public void testInsert() {
   boolean isOK = db.insertSingleRun(prepareDataSingleRun(12));
   assertTrue(isOK);
 }