forked from fmendozaro/junit-tests
-
Notifications
You must be signed in to change notification settings - Fork 622
Expand file tree
/
Copy pathCohortTest.java
More file actions
35 lines (31 loc) · 847 Bytes
/
CohortTest.java
File metadata and controls
35 lines (31 loc) · 847 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
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class CohortTest {
Cohort venus;
@Before
public void init() {
venus = new Cohort();
Student Cody = new Student(1, "Cody");
venus.addStudent(Cody);
Cody.addGrade(85);
Cody.addGrade(90);
Student DocRob = new Student(2, "DocRob");
venus.addStudent(DocRob);
DocRob.addGrade(88);
DocRob.addGrade(97);
}
@Test
public void testStudentAdd() {
assertEquals(2, venus.getStudents().size());
}
@Test
public void testGetCurrentList() {
assertNotNull(venus.getStudents());
}
@Test
public void testGetAverage() {
assertEquals(90.0,venus.getCohortAverage(),2);
}
}