So i have a simple user validation function and i want to write unit test about it. I want it to pass only when it's triggering another function, how can i write this logic?
Here is the function
func validateUser(request: Login.UserValidation.Request) {
// unwrapping email and password above this
if email == "" || password == "" {
presenter?.presentUserValidationOutcome(response: response)
}
Here is the unit test i want to write
func test_validateUserFailure() {
// Given
let email = "test"
let password = ""
// When
sut.validateUser(request: Login.UserValidation.Request(email: email, password: password))
// Then
// check if it triggered presenter's function
}