|
@@ -1,6 +1,53 @@
|
1
|
1
|
package com.example.demo;
|
2
|
2
|
|
|
3
|
+import org.junit.Assert;
|
|
4
|
+import org.junit.Before;
|
|
5
|
+import org.junit.Test;
|
|
6
|
+import org.junit.runner.RunWith;
|
|
7
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
8
|
+import org.springframework.boot.test.context.SpringBootTest;
|
|
9
|
+import org.springframework.test.context.junit4.SpringRunner;
|
|
10
|
+
|
|
11
|
+@RunWith(SpringRunner.class)
|
|
12
|
+@SpringBootTest
|
3
|
13
|
public class ClassromConfigTest {
|
4
|
14
|
|
5
|
|
-
|
|
15
|
+Classroom currentCohort;
|
|
16
|
+Classroom prevCohort;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+ @Autowired
|
|
20
|
+ ClassroomConfig classroomConfig;
|
|
21
|
+ @Before
|
|
22
|
+ public void setUp(){
|
|
23
|
+ currentCohort = classroomConfig.currentCohort();
|
|
24
|
+ prevCohort= classroomConfig.previousCohort();
|
|
25
|
+ }
|
|
26
|
+@Test
|
|
27
|
+ public void CurrentCohortTest(){
|
|
28
|
+ Assert.assertEquals(currentCohort, classroomConfig.currentCohort());
|
|
29
|
+}@Test
|
|
30
|
+ public void CurrentCohortTest1(){
|
|
31
|
+ Assert.assertNotEquals(currentCohort, classroomConfig.previousCohort());
|
|
32
|
+ }
|
|
33
|
+ @Test
|
|
34
|
+ public void CurrentCohortTest2(){
|
|
35
|
+ Assert.assertNotNull(classroomConfig.currentCohort());
|
|
36
|
+ }
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+ @Test
|
|
40
|
+ public void previousCohortTest1(){
|
|
41
|
+ Assert.assertEquals(prevCohort, classroomConfig.previousCohort());
|
|
42
|
+
|
|
43
|
+ }
|
|
44
|
+ @Test
|
|
45
|
+ public void previousCohortTest2(){
|
|
46
|
+ Assert.assertNotNull(classroomConfig.previousCohort());
|
|
47
|
+
|
|
48
|
+ }
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
6
|
53
|
}
|