Skip to content

Instantly share code, notes, and snippets.

@weAreJack
Created October 2, 2020 12:04
Show Gist options
  • Save weAreJack/af1ac6a7de66c9bd3b235a760646b71b to your computer and use it in GitHub Desktop.
Save weAreJack/af1ac6a7de66c9bd3b235a760646b71b to your computer and use it in GitHub Desktop.
MockLoginPresenterExample
@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