Created
October 13, 2015 14:29
-
-
Save patrykpoborca/b327054d326d376d7cd6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class MainActivityPresenterTestOptionOne implements IMainActivity { | |
private static final String SOME_MOCKED_MESSAGE = "Some Mocked Message"; | |
private Resources resources; | |
private MainActivityPresenter mainActivityPresenter; | |
@Before | |
public void setup(){ | |
resources = Mockito.mock(Resources.class); | |
Mockito.when(resources.getString(R.string.hello_world)).thenReturn(SOME_MOCKED_MESSAGE); | |
mainActivityPresenter = new MainActivityPresenter(); | |
mainActivityPresenter.registerPresenterView(this); | |
mainActivityPresenter.setResources(resources); | |
} | |
@Test | |
public void testToastMessage(){ | |
mainActivityPresenter.fabClicked(); | |
} | |
@Override | |
public void showToast(String message) { | |
Assert.assertTrue(SOME_MOCKED_MESSAGE.equals(message)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment