date-range added
[staff/due1/sed-hs15-srs-purple.git] / src / test / java / ch / bfh / ti / srs / dataschema / ResourceTest.java
CommitLineData
9a78ca13
MT
1/*\r
2 * Copyright (c) 2015 Berner Fachhochschule, Switzerland.\r
3 *\r
4 * Project Smart Reservation System.\r
5 *\r
6 * Distributable under GPL license. See terms of license at gnu.org.\r
7 */\r
496127a5 8package ch.bfh.ti.srs.dataschema;\r
9a78ca13
MT
9\r
10import static org.junit.Assert.assertEquals;\r
11\r
12import org.junit.Test;\r
13\r
14import ch.bfh.ti.srs.dataschema.Resource;\r
15\r
16public class ResourceTest {\r
17\r
18 @Test\r
19 public void createResurceTest() throws Exception {\r
20 Resource testResource = new Resource("N321", "class room");\r
21 assertEquals("N321", testResource.getName());\r
22 assertEquals("class room", testResource.getType());\r
23 }\r
24\r
25 @Test(expected=IllegalArgumentException.class)\r
26 public void createUserInvalidNameTest() throws Exception{\r
27 Resource testResource = new Resource(null, "class room");\r
28 }\r
29 \r
30 @Test\r
31 public void setAndGetNameTest() throws Exception {\r
32 Resource testRessource = new Resource("N321", "class room");\r
33 testRessource.setName("N421");\r
34 assertEquals("N421", testRessource.getName());\r
35 testRessource.setName(null);\r
36 assertEquals(null, testRessource.getName());\r
37 }\r
38\r
39 @Test\r
40 public void setAndGetTypeTest() throws Exception {\r
41 Resource testRessource = new Resource("N321", "class room");\r
42 testRessource.setType("lecture hall");\r
43 assertEquals("lecture hall", testRessource.getType());\r
44 testRessource.setType(null);\r
45 assertEquals(null, testRessource.getType());\r
46 }\r
47}\r