Last active
January 30, 2018 14:21
-
-
Save HIFILEO/d0dc1ccab8b0e87130c126fc2ebcc4d5 to your computer and use it in GitHub Desktop.
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
@Test | |
public void initState() { | |
//Arrange | |
TestObserver<UiModel> testObserver; | |
TestNowPlayingViewModel nowPlayingViewModel = new TestNowPlayingViewModel(***); | |
nowPlayingViewModel.init(null); | |
when(mockTestTransformer.transform(any(Action.class))).thenReturn(Observable.<Result>empty()); | |
//Act | |
testObserver = nowPlayingViewModel.getUiModels().test(); | |
testScheduler.triggerActions(); | |
//Assert | |
testObserver.assertNoErrors(); | |
testObserver.assertValueCount(1); | |
UiModel uiModel = (UiModel) testObserver.getEvents().get(0).get(0); | |
assertThat(uiModel).isNotNull(); | |
assertThat(uiModel.isFirstTimeLoad()).isTrue(); | |
assertThat(uiModel.getAdapterCommandType()).isEqualTo(AdapterCommandType.DO_NOTHING); | |
/* More Asserts...*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment