-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentServiceTest.java
More file actions
31 lines (24 loc) · 892 Bytes
/
StudentServiceTest.java
File metadata and controls
31 lines (24 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package sba.sms.services;
import org.junit.jupiter.api.*;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import sba.sms.models.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
class StudentServiceTest {
private StudentService studentService;
@BeforeEach
void setUp() {
studentService = new StudentService();
}
@ParameterizedTest
@CsvSource({
"annette@gmail.com, password, true",
"anthony@gmail.com, password, true",
"ariadna@gmail.com, password, true"
})
void testValidateStudent(String email, String password, boolean expected) {
Student student = new Student(email, "Test Student", password);
studentService.createStudent(student);
assertEquals(expected, studentService.validateStudent(email, password));
}
}