Last active
October 1, 2020 10:24
-
-
Save weAreJack/52392a403f3322033fb29450d3b4d85c to your computer and use it in GitHub Desktop.
MockLoginPresenterExample
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
| @testable import VIPER_Example | |
| import Foundation | |
| class MockLoginPresenter: LoginPresenterProtocol, LoginInteractorOutputProtocol { | |
| // MARK: - LoginPresenterProtocol | |
| var interactor: LoginInteractorInputProtocol? | |
| // MARK: - Properties | |
| var usernameDidChangeCalled = false | |
| var passwordDidChangeCalled = false | |
| var logInTappedCalled = false | |
| var didLogInSuccessfullyCalled = false | |
| var didFailToLogInCalled = false | |
| // MARK: - LoginPresenterProtocol Methods | |
| func usernameDidChange(_ username: String?) { | |
| usernameDidChangeCalled = true | |
| } | |
| func passwordDidChange(_ password: String?) { | |
| passwordDidChangeCalled = true | |
| } | |
| func logInTapped() { | |
| logInTappedCalled = true | |
| } | |
| // MARK: - LoginInteractorOutputProtocol Methods | |
| func didLogInSuccessfully() { | |
| didLogInSuccessfullyCalled = true | |
| } | |
| func didFailToLogIn() { | |
| didFailToLogInCalled = true | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment