1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.bo;
17
18 import java.util.LinkedHashMap;
19
20 import org.junit.Test;
21 import org.kuali.rice.kns.bo.CampusImpl;
22 import org.kuali.rice.kns.bo.CampusType;
23 import org.kuali.rice.kns.bo.CampusTypeImpl;
24 import org.kuali.rice.kns.util.KNSPropertyConstants;
25 import org.kuali.test.KNSTestCase;
26
27
28
29
30
31
32
33 public class CampusImplTest extends KNSTestCase{
34
35 CampusImpl dummyCampus;
36
37
38 @Override
39 public void setUp() throws Exception {
40 super.setUp();
41 dummyCampus = new CampusImpl();
42
43 }
44
45 @Override
46 public void tearDown() throws Exception {
47 super.tearDown();
48 dummyCampus = null;
49 }
50
51 @Test
52 public void testCampusCode(){
53 dummyCampus.setCampusCode("OSU");
54 assertEquals("Testing CampusCode in CampusImplTest", "OSU",dummyCampus.getCampusCode());
55 }
56 @Test
57 public void testCampusName(){
58 dummyCampus.setCampusName("Ohio State University-Columbus");
59 assertEquals("Testing CampusName in CampusImplTest","Ohio State University-Columbus",dummyCampus.getCampusName());
60 }
61 @Test
62 public void testCampusShortName(){
63 dummyCampus.setCampusShortName("OSU");
64 assertEquals("Testing CampusShortName in CamplusImplTest","OSU",dummyCampus.getCampusShortName());
65 }
66 @Test
67 public void testCampusTypeCode(){
68 dummyCampus.setCampusTypeCode("College");
69 assertEquals("Testing CampustypeCode in CampusImplTest","College",dummyCampus.getCampusTypeCode());
70 }
71 @Test
72 public void testActive(){
73 dummyCampus.setActive(true);
74 assertTrue("Testing Active in CampusImplTest",dummyCampus.isActive());
75 }
76
77 @SuppressWarnings("deprecation")
78 @Test
79 public void testCampusType(){
80 CampusType dummyCampusType = new CampusTypeImpl();
81
82 dummyCampus.setCampusType(dummyCampusType);
83 assertTrue("Testing CampusType in CampusImplTest", dummyCampus.getCampusType().equals(dummyCampusType));
84 }
85
86 @Test
87 public void testToStringMapper(){
88 dummyCampus.setCampusCode("campusCode");
89 LinkedHashMap dummyMap = dummyCampus.toStringMapper();
90 assertEquals("Testing toStringMapper of CampusImpl",dummyCampus.getCampusCode() , dummyMap.get(KNSPropertyConstants.CAMPUS_CODE));
91 }
92 }