Created
February 15, 2021 22:33
-
-
Save jparanda/02aa0c405d29c89b1801491e82fe16ee to your computer and use it in GitHub Desktop.
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
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import static org.junit.jupiter.api.Assertions.assertTrue; | |
class EmailValidatorTest { | |
private static final String VALID_EMAIL = "juan.aranda.galvis@gmail.com"; | |
private static final String INVALID_EMAIL = "juan.aranda.galvis@gmail"; | |
private EmailValidator emailValidator; | |
@BeforeEach | |
void setup() { | |
emailValidator = new EmailValidator(); | |
} | |
@Test | |
void validateEmail_validEmail() throws IllegalArgumentException { | |
Boolean expectedValidation = emailValidator.validateEmail(VALID_EMAIL); | |
assertEquals(Boolean.TRUE, expectedValidation); | |
} | |
@Test | |
void validateEmail_invalidEmail() throws IllegalArgumentException { | |
Boolean expectedValidation = emailValidator.validateEmail(INVALID_EMAIL); | |
assertEquals(Boolean.FALSE, expectedValidation); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment