-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#47 added FinisheWorkoutRepository and added new a option to save cur…
…rent workout
- Loading branch information
Showing
11 changed files
with
165 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/de/avalax/fitbuddy/domain/model/workout/FinishedWorkoutRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package de.avalax.fitbuddy.domain.model.workout; | ||
|
||
public interface FinishedWorkoutRepository { | ||
void save(Workout workout); | ||
} |
17 changes: 17 additions & 0 deletions
17
...ain/java/de/avalax/fitbuddy/port/adapter/persistence/SQLiteFinishedWorkoutRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package de.avalax.fitbuddy.port.adapter.persistence; | ||
|
||
import android.database.sqlite.SQLiteOpenHelper; | ||
import de.avalax.fitbuddy.domain.model.set.SetRepository; | ||
import de.avalax.fitbuddy.domain.model.workout.FinishedWorkoutRepository; | ||
import de.avalax.fitbuddy.domain.model.workout.Workout; | ||
|
||
public class SQLiteFinishedWorkoutRepository implements FinishedWorkoutRepository { | ||
public SQLiteFinishedWorkoutRepository(SQLiteOpenHelper sqLiteOpenHelper) { | ||
//TODO: init | ||
} | ||
|
||
@Override | ||
public void save(Workout workout) { | ||
//TODO: persist workout with exercises and sets | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...java/de/avalax/fitbuddy/port/adapter/persistence/SQLiteFinishedWorkoutRepositoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package de.avalax.fitbuddy.port.adapter.persistence; | ||
|
||
import android.content.Context; | ||
import de.avalax.fitbuddy.presentation.R; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.robolectric.Robolectric; | ||
import org.robolectric.RobolectricTestRunner; | ||
import org.robolectric.annotation.Config; | ||
|
||
@Config(emulateSdk = 18) | ||
@RunWith(RobolectricTestRunner.class) | ||
public class SQLiteFinishedWorkoutRepositoryTest { | ||
private SQLiteFinishedWorkoutRepository sqLiteFinishedWorkoutRepository; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
Context context = Robolectric.application.getApplicationContext(); | ||
FitbuddySQLiteOpenHelper sqLiteOpenHelper = new FitbuddySQLiteOpenHelper("SQLiteSetRepositoryTest", 1, context, R.raw.fitbuddy_db); | ||
sqLiteFinishedWorkoutRepository = new SQLiteFinishedWorkoutRepository(sqLiteOpenHelper); | ||
} | ||
|
||
@Test | ||
public void nothing() throws Exception { | ||
sqLiteFinishedWorkoutRepository.save(null); | ||
} | ||
} |