-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d040eb
commit b7f190b
Showing
2 changed files
with
27 additions
and
38 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,50 +24,39 @@ | |
*/ | ||
@RunWith(MockitoJUnitRunner.class) | ||
public class MockitoPresenterTests { | ||
// @Mock | ||
// MainActivity view; | ||
// | ||
// @Mock | ||
// LoginPage loginView; | ||
|
||
// @Test | ||
// public void testMainNavigation(){ | ||
// when(loginView.navigateToPatientSignup()).getMock(); | ||
// } | ||
|
||
// @Mock | ||
// PatientActivity patView; | ||
// @Mock | ||
// FirebaseUser patient; | ||
// @Mock | ||
// DatabaseReference ref; | ||
// @Mock | ||
// private String userID; | ||
|
||
|
||
@Mock | ||
LoginPage loginView; | ||
|
||
LoginPage view; | ||
@Mock | ||
Model model; | ||
|
||
@Test | ||
public void presenterTest(){ | ||
when(loginView.getEmail()).thenReturn("[email protected]"); | ||
when(loginView.getPassword()).thenReturn("abc"); | ||
when(model.userIsFound("[email protected]", "abc")).thenReturn(true); | ||
Presenter presenter = new Presenter(model, loginView); | ||
when(view.getEmail()).thenReturn("[email protected]"); | ||
when(view.getPassword()).thenReturn("abcdef"); | ||
when(model.userIsFound("[email protected]", "abcdef")).thenReturn(true); | ||
|
||
Presenter presenter = new Presenter(model, view); | ||
presenter.login(); | ||
verify(loginView).displayMessage("trying to login"); | ||
verify(view).displayMessage("trying to login"); | ||
} | ||
|
||
// @Mock | ||
// DoctorActivity docView; | ||
|
||
// @Mock | ||
// MainActivity view; | ||
// | ||
// @Mock | ||
// LoginPage loginView; | ||
|
||
// @Test | ||
// public void testMainNavigation(){ | ||
// when(loginView.navigateToPatientSignup()).getMock(); | ||
// } | ||
|
||
// @Mock | ||
// PatientActivity patView; | ||
// @Mock | ||
// FirebaseUser patient; | ||
// @Mock | ||
// DatabaseReference ref; | ||
// @Mock | ||
// private String userID; | ||
|
||
// @Test | ||
// public void addition_isCorrect() { | ||
// assertEquals(4, 2 + 2); | ||
// } | ||
} |