SessionController added/updated
[staff/due1/sed-hs15-srs-purple.git] / src / test / java / ch / bfh / ti / srs / controller / ResourceManagerControllerTest.java
index 4fcb251..1a71767 100644 (file)
@@ -19,7 +19,7 @@ public class ResourceManagerControllerTest {
        @Test\r
        public void AddResourceTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
-               SessionController  sc = new SessionController();\r
+               SessionController  sc = new SessionController(dh);\r
                ResourceManagerController rmc = new ResourceManagerController(dh, sc);\r
                Resource testResource = new Resource("N321", "class room");\r
                \r
@@ -29,7 +29,7 @@ public class ResourceManagerControllerTest {
        @Test\r
        public void ChangeResourceTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
-               SessionController  sc = new SessionController();\r
+               SessionController  sc = new SessionController(dh);\r
                ResourceManagerController rmc = new ResourceManagerController(dh, sc);\r
                Resource testResource = new Resource("N321", "class room");\r
                \r
@@ -41,7 +41,7 @@ public class ResourceManagerControllerTest {
        @Test\r
        public void DeleteResourceTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
-               SessionController  sc = new SessionController();\r
+               SessionController  sc = new SessionController(dh);\r
                ResourceManagerController rmc = new ResourceManagerController(dh, sc);\r
                Resource testResource = new Resource("N321", "class room");\r
                \r
@@ -51,7 +51,8 @@ public class ResourceManagerControllerTest {
        \r
        @Test(expected = Exception.class)\r
        public void AddResourceInvalidDatahandlerTest() throws Exception {\r
-               SessionController  sc = new SessionController();\r
+               DataHandler dh = new DataHandlerForTests();\r
+               SessionController  sc = new SessionController(dh);\r
                ResourceManagerController rmc = new ResourceManagerController(null, sc);\r
                Resource testResource = new Resource("N321", "class room");\r
                \r
@@ -62,7 +63,7 @@ public class ResourceManagerControllerTest {
        @Test(expected = IllegalArgumentException.class)\r
        public void AddResourceInvalidResourceTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
-               SessionController  sc = new SessionController();\r
+               SessionController  sc = new SessionController(dh);\r
                ResourceManagerController rmc = new ResourceManagerController(dh, sc);\r
                Resource testResource = null;\r
                \r
@@ -72,7 +73,7 @@ public class ResourceManagerControllerTest {
        @Test(expected = Exception.class)\r
        public void ChangeResourceInvalidDatahandlerTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
-               SessionController  sc = new SessionController();\r
+               SessionController  sc = new SessionController(dh);\r
                ResourceManagerController rmc1 = new ResourceManagerController(dh, sc);\r
                ResourceManagerController rmc2 = new ResourceManagerController(null, sc);\r
                Resource testResource = new Resource("N321", "class room");\r
@@ -85,7 +86,7 @@ public class ResourceManagerControllerTest {
        @Test(expected = IllegalArgumentException.class)\r
        public void ChangeResourceInvalidResourceTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
-               SessionController  sc = new SessionController();\r
+               SessionController  sc = new SessionController(dh);\r
                ResourceManagerController rmc = new ResourceManagerController(dh, sc);\r
                Resource testResource = new Resource("N321", "class room");\r
                \r
@@ -97,7 +98,7 @@ public class ResourceManagerControllerTest {
        @Test(expected = Exception.class)\r
        public void DeleteResourceInvalidDatahandlerTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
-               SessionController  sc = new SessionController();\r
+               SessionController  sc = new SessionController(dh);\r
                ResourceManagerController rmc1 = new ResourceManagerController(dh, sc);\r
                ResourceManagerController rmc2 = new ResourceManagerController(null, sc);\r
                Resource testResource = new Resource("N321", "class room");\r
@@ -110,7 +111,7 @@ public class ResourceManagerControllerTest {
        @Test(expected = IllegalArgumentException.class)\r
        public void DeleteResourceInvalidResourceTest() throws Exception {\r
                DataHandler dh = new DataHandlerForTests();\r
-               SessionController  sc = new SessionController();\r
+               SessionController  sc = new SessionController(dh);\r
                ResourceManagerController rmc = new ResourceManagerController(dh, sc);\r
                Resource testResource = new Resource("N321", "class room");\r
                \r