EpisodeCheckpoint { public int getLastCheckpointPosition(Episode episode, int defaultPosition) { SharedPreferences sharedPreferences = getSharedPreferences(); return sharedPreferences.getInt(episodeKey(episode), defaultPosition); } @Inject  EpisodeCheckpoint(Context context); int markCheckpoint(Episode episode, int currentPosition); int getLastCheckpointPosition(Episode episode, int defaultPosition); static final String STATE; }
@Test public void itReturnsDefaultValueWhenCouldNotFindEpisodeCheckpointOfPlayingEpisode() { assertThat(episodeCheckpoint.getLastCheckpointPosition(anEpisode(), 42), is(42)); }