@Test public void getValidTimeline() throws Exception { final Timeline validTimeline = new TimelineBuilder().setScore(1, ScoreCondition.IDEAL).build(); final Timeline result = lastNightInteractor.getValidTimeline(validTimeline); assertThat(result, equalTo(validTimeline)); }
@VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } }
LastNightInteractor extends ValueInteractor<Timeline> { @VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } } }
LastNightInteractor extends ValueInteractor<Timeline> { @VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } }  }
LastNightInteractor extends ValueInteractor<Timeline> { @VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } }   }
LastNightInteractor extends ValueInteractor<Timeline> { @VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } }   final InteractorSubject<Timeline> timeline; }