refactor: move test files
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package BonusTests;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
public class TestEmail {
|
||||
static BonusExercises ex;
|
||||
|
||||
@BeforeAll
|
||||
static void setUp() {
|
||||
ex = new BonusExercises();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEmail0() {
|
||||
assertTrue(ex.validateEmail("john.doe@example.com"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEmail1() {
|
||||
assertFalse(ex.validateEmail("hello world@example.com"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEmail2() {
|
||||
assertTrue(ex.validateEmail("alice_bob123@research-lab.co.uk"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEmail3() {
|
||||
assertFalse(ex.validateEmail("user@ex_ample.com"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEmail4() {
|
||||
assertFalse(ex.validateEmail("user.@-example.com"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user