-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGradesTest.java
More file actions
45 lines (38 loc) · 956 Bytes
/
Copy pathGradesTest.java
File metadata and controls
45 lines (38 loc) · 956 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package GradeSystemProjcect;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class GradesTest {
Grades aGrade = null;
@Before
public void setUp() throws Exception {
aGrade = new Grades();
}
@After
public void tearDown() throws Exception {
aGrade = null;
}
@Test
public final void testCalculateTotalGrade_1() {
aGrade.lab1 = 55;
aGrade.lab2 = 65;
aGrade.lab3 = 75;
aGrade.midTerm = 85;
aGrade.finalTerm = 95;
int[] weights = {10, 20, 10, 30, 30};
aGrade.calculateTotalGrade(weights);
assertEquals(80, aGrade.totalGrade);
}
@Test
public final void testCalculateTotalGrade_2() {
aGrade.lab1 = 71;
aGrade.lab2 = 55;
aGrade.lab3 = 84;
aGrade.midTerm = 85;
aGrade.finalTerm = 90;
int[] weights = {10, 10, 10, 30, 40};
aGrade.calculateTotalGrade(weights);
assertEquals(83, aGrade.totalGrade);
}
}