-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstudentTest.java
More file actions
86 lines (72 loc) · 2.45 KB
/
studentTest.java
File metadata and controls
86 lines (72 loc) · 2.45 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Created by meudecc on 15/02/2017.
*/
public class studentTest {
@org.junit.Test(expected = IllegalArgumentException.class)
public void belowZero() throws Exception {
Student std = new Student();
std.getAttendanceGrade(-1);
}
@org.junit.Test(expected = IllegalArgumentException.class)
public void muchBelowZero() throws Exception {
Student std = new Student();
std.getAttendanceGrade(-42);
}
@org.junit.Test(expected = IllegalArgumentException.class)
public void above100() throws Exception {
Student std = new Student();
std.getAttendanceGrade(101);
}
@org.junit.Test(expected = IllegalArgumentException.class)
public void muchAbove100() throws Exception {
Student std = new Student();
std.getAttendanceGrade(142);
}
@org.junit.Test
public void absent() {
Student std = new Student();
assertEquals(Student.AttendanceGrade.ABSENT, std.getAttendanceGrade(0));
}
@org.junit.Test
public void lowVeryPoor() {
Student std = new Student();
assertEquals(Student.AttendanceGrade.VERY_POOR, std.getAttendanceGrade(1));
}
@org.junit.Test
public void highVeryPoor() {
Student std = new Student();
assertEquals(Student.AttendanceGrade.VERY_POOR, std.getAttendanceGrade(29));
}
@org.junit.Test
public void lowAverage() {
Student std = new Student();
assertEquals(Student.AttendanceGrade.AVERAGE, std.getAttendanceGrade(30));
}
@org.junit.Test
public void highAverage() {
Student std = new Student();
assertEquals(Student.AttendanceGrade.AVERAGE, std.getAttendanceGrade(69));
}
@org.junit.Test
public void lowGood() {
Student std = new Student();
assertEquals(Student.AttendanceGrade.GOOD, std.getAttendanceGrade(70));
}
@org.junit.Test
public void highGood() {
Student std = new Student();
assertEquals(Student.AttendanceGrade.GOOD, std.getAttendanceGrade(89));
}
@org.junit.Test
public void lowVeryGood() {
Student std = new Student();
assertEquals(Student.AttendanceGrade.VERY_GOOD, std.getAttendanceGrade(90));
}
@org.junit.Test
public void highVeryGood() {
Student std = new Student();
assertEquals(Student.AttendanceGrade.VERY_GOOD, std.getAttendanceGrade(100));
}
}