View Javadoc

1   /*
2    * Copyright 2007-2010 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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   * This is a description of what this class does - chang don't forget to fill this in. 
29   * 
30   * @author Kuali Rice Team (rice.collab@kuali.org)
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  }