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()); }
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); } }
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); }
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); } }
@Override protected void tearDown() throws Exception { super.tearDown(); mContext.deleteDatabase(db.getDBName()); db = null; }
public void testInsertWorkout() { boolean isOK = db.insertWorkout(prepareWorkout(13)) != -1; assertTrue(isOK); }
public void testInsert() { boolean isOK = db.insertSingleRun(prepareDataSingleRun(12)); assertTrue(isOK); }