Created
April 4, 2017 10:16
-
-
Save kmmraj/9341b27179e022b179cc93f206b7c792 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 onCreate_shouldCall_fetchHomeMetaData(){ | |
//Given | |
HomeActivityOutputSpy homeActivityOutputSpy = new HomeActivityOutputSpy(); | |
HomeActivity homeActivity = Robolectric.setupActivity(HomeActivity.class); | |
// It must have called the onCreate earlier, | |
// we are injecting the mock and calling the fetchMetaData to test our condition | |
homeActivity.output = homeActivityOutputSpy; | |
//When | |
homeActivity.fetchMetaData(); | |
//Then | |
Assert.assertTrue(homeActivityOutputSpy.fetchHomeMetaDataIsCalled); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment