{"action":"created","comment":{"url":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/comments/212500811","pull_request_review_id":149149632,"id":212500811,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjUwMDgxMQ==","diff_hunk":"@@ -31,249 +48,756 @@ public RoomControllerTest()\n                 State = \"Ca\"\n             };\n \n-            _room = new Room.Library.Models.Room\n+            Room.Context.Models.Address address2 = new Room.Context.Models.Address()\n             {\n-                RoomId = Guid.NewGuid(),\n-                Address = _address,\n-                Location = \"Tampa\",\n+                AddressId = addressId2,\n+                Address1 = \"6789 Example rd.\",\n+                Address2 = \"\",\n+                City = \"Reston\",\n+                Country = \"US\",\n+                PostalCode = \"44084\",\n+                State = \"Va\"\n+            };\n+\n+            //give values to validRoom1\n+            Room.Context.Models.Room validRoom1 = new Room.Context.Models.Room\n+            {\n+                RoomId = roomId1,\n+                Address = address1,\n+                Location = \"Tampa, FL\",\n                 Vacancy = 1,\n                 Occupancy = 2,\n                 Gender = \"M\"\n             };\n+\n+            //give values to validRoom2\n+            Room.Context.Models.Room validRoom2 = new Room.Context.Models.Room\n+            {\n+                RoomId = roomId2,\n+                Address = address2,\n+                Location = \"Reston, VA\",\n+                Vacancy = 2,\n+                Occupancy = 4,\n+                Gender = \"F\"\n+            };\n+\n+            //add rooms to context\n+            contextRooms.Add(validRoom1);\n+            contextRooms.Add(validRoom2);\n+        }\n+\n+        /// <summary>\n+        /// A valid get should return 200 status code and appropriate list of rooms.\n+        /// </summary>\n+        [Fact]\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Get_Valid_Returns200AndList()\n+        {\n+            mockRepo.Setup(x => x.GetAsync()).ReturnsAsync(contextRooms);\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            var result = await ctrl.Get();\n+\n+            var roomResult = Assert.IsAssignableFrom<ObjectResult>(result);\n+\n+            var roomValue = roomResult.Value;\n+            \n+            var roomList = Assert.IsAssignableFrom <List<Room.Library.Models.Room>>(roomValue);\n+            \n+            Assert.Equal(200, roomResult.StatusCode);\n+            Assert.Equal(2, roomList.Count);\n+            Assert.Equal(contextRooms[0].Gender, roomList[0].Gender);\n+            Assert.Equal(contextRooms[1].Gender, roomList[1].Gender);\n         }\n \n+        /// <summary>\n+        /// Exception thrown should return 500 status code.\n+        /// </summary>\n         [Fact]\n-        public async Task TestControllerGet()\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Get_Invalid_Returns500()\n         {\n-            //Arrange\n+            mockRepo.Setup(x => x.GetAsync()).ThrowsAsync(new Exception());\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            var result = await ctrl.Get();\n+\n+            var roomResult = Assert.IsAssignableFrom<StatusCodeResult>(result);\n+            \n+            Assert.Equal(500, roomResult.StatusCode);\n+        }\n \n-            _room.Address = _address;\n-            var id = _room.RoomId;\n-            await _context.InsertAsync(ModelMapper.LibraryToContext(_room));\n-            var roomController = new RoomController(new LoggerFactory(), _context, null);\n+        /// <summary>\n+        /// Null rooms should return 500 status code.\n+        /// </summary>\n+        [Fact]\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Get_NoRooms_Returns500()\n+        { \n+            List<Room.Context.Models.Room> emptyContextRooms = new List<Room.Context.Models.Room>();\n \n+            mockRepo.Setup(x => x.GetAsync()).ReturnsAsync(emptyContextRooms);\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            var result = await ctrl.Get();\n \n-            //Act\n-            var myTask = roomController.Get();\n-            var result = await myTask;\n-            var contentResult = result as OkObjectResult;\n+            var roomResult = Assert.IsAssignableFrom<StatusCodeResult>(result);\n+            \n+            Assert.Equal(500, roomResult.StatusCode);\n+        }\n \n+        /// <summary>\n+        /// Get room by Id should return 200 status code and the approriate room.\n+        /// </summary>\n+        [Fact]\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task GetById_Valid_Returns200AndRoom()\n+        {\n+            mockRepo.Setup(x => x.GetByIdAsync(It.IsAny<Guid>())).ReturnsAsync(((Guid y) => contextRooms.First(z => z.RoomId == y)));\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            var result = await ctrl.Get(roomId1);\n \n-            var list = contentResult.Value as List<Room.Library.Models.Room>;\n-            var id1 = list[0].RoomId;\n+            var roomResult = Assert.IsAssignableFrom<ObjectResult>(result);\n \n-            Assert.Equal(id,id1);\n+            var roomValue = roomResult.Value;\n \n+            var roomItem = Assert.IsAssignableFrom<Room.Library.Models.Room>(roomValue);\n+            \n+            Assert.Equal(200, roomResult.StatusCode);\n+            Assert.Equal(contextRooms[0].Gender, roomItem.Gender);\n         }\n \n+        /// <summary>\n+        /// An empty Id should return 400 status code\n+        /// </summary>\n         [Fact]\n-        public async Task TestControllerGetById()\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task GetById_InvalidId_Returns400()\n         {\n-            //Arrange\n+            mockRepo.Setup(x => x.GetByIdAsync(It.IsAny<Guid>()))\n+                .ReturnsAsync(((Guid y) => contextRooms.First(z => z.RoomId == y)));\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n \n-            _room.Address = _address;\n-            var id = _room.RoomId;\n-            await _context.InsertAsync(ModelMapper.LibraryToContext(_room));\n-            var roomController = new RoomController(new LoggerFactory(), _context, null);\n+            var resultEmpty = await ctrl.Get(Guid.Empty);\n+\n+            Assert.IsAssignableFrom<ObjectResult>(resultEmpty);\n+        }\n \n+        /// <summary>\n+        /// An Invalid Id should return 404 status code.\n+        /// </summary>\n+        [Fact]\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task GetById_InvalidId_Returns404()\n+        {\n+            mockRepo.Setup(x => x.GetByIdAsync(It.IsAny<Guid>()))\n+                .ReturnsAsync(((Guid y) => contextRooms.First(z => z.RoomId == y)));\n \n-            var myTask = roomController.Get(id);\n-            var result = await myTask;\n-            var contentResult = result as OkObjectResult;\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            var resultNotFound = await ctrl.Get(Guid.NewGuid());\n \n-            var roomReturned = contentResult.Value as Room.Library.Models.Room;\n+            var roomResult = Assert.IsAssignableFrom<ObjectResult>(resultNotFound);\n \n-            Assert.Equal(id,roomReturned.RoomId);\n+            Assert.Equal(404, roomResult.StatusCode);\n         }\n \n+        /// <summary>\n+        /// Invalid Address Id should return 500 status code.\n+        /// </summary>\n         [Fact]\n-        public async Task TestControllerGetByIdWithInvalidArgument()\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task GetById_InvalidId_Returns500()\n         {\n-            //Arrange\n+            List<Room.Context.Models.Room> emptyContextRooms = new List<Room.Context.Models.Room>();\n+            \n+            Room.Context.Models.Room newRoom = new Room.Context.Models.Room\n+            {\n+                RoomId = newRoomId,\n+                Address = new Room.Context.Models.Address\n+                {\n+                    AddressId = Guid.NewGuid(),\n+                    Address1 = \"5432 Newpost ln\",\n+                    Address2 = \"\",\n+                    City = \"Charlotte\",\n+                    State = \"NC\",\n+                    PostalCode = \"28112\",\n+                    Country = \"Us\"\n+                },\n+                Location = \"Charlotte, NC\",\n+                Vacancy = 3,\n+                Occupancy = 6,\n+                Gender = null\n+            };\n+            \n+            emptyContextRooms.Add(newRoom);\n+            \n+            mockRepo.Setup(x => x.GetByIdAsync(It.IsAny<Guid>()))\n+                .ReturnsAsync(((Guid y) => emptyContextRooms.First(z => z.RoomId == y)));\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            var result = await ctrl.Get(newRoomId);\n \n-            _room.Address = _address;\n-            await _context.InsertAsync(ModelMapper.LibraryToContext(_room));\n-            var roomController = new RoomController(new LoggerFactory(), _context, null);\n+            var roomResult = Assert.IsAssignableFrom<StatusCodeResult>(result);\n+            \n+            Assert.Equal(500, roomResult.StatusCode);\n+        }\n \n-            var myTask = roomController.Get(Guid.Empty);\n-            var result = await myTask;\n-           \n+        /// <summary>\n+        /// Valid post should return 200 status code.\n+        /// </summary>\n+        [Fact]\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Post_Valid_Returns200()\n+        {\n+            mockRepo.Setup(r => r.InsertAsync(It.IsAny<Room.Context.Models.Room>()))\n+                .Returns(Task.CompletedTask);\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            Room.Library.Models.Room newRoom = new Room.Library.Models.Room\n+            {\n+                Address = new Room.Library.Models.Address\n+                {\n+                    AddressId = Guid.NewGuid(),\n+                    Address1 = \"5432 Newpost ln\",\n+                    Address2 = \"\",\n+                    City = \"Charlotte\",\n+                    State = \"NC\",\n+                    PostalCode = \"28112\",\n+                    Country = \"Us\"\n+                },\n+                Location = \"Charlotte, NC\",\n+                Vacancy = 3,\n+                Occupancy = 6,\n+                Gender = \"M\"\n+            };\n+            \n+            var result = await ctrl.Post(newRoom);\n \n-            var contentResult = result as BadRequestObjectResult;\n+            var roomResult = Assert.IsAssignableFrom<CreatedAtRouteResult>(result);\n             \n-            Assert.NotNull(contentResult);\n-            var code = (int)contentResult.StatusCode;\n-            Assert.InRange(code, 400, 499);\n+            Assert.Equal(201, roomResult.StatusCode);\n         }\n \n+        /// <summary>\n+        /// Posting null value should return 400 status code.\n+        /// </summary>\n         [Fact]\n-        public async Task TestControllerPost()\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Post_Null_Returns400()\n         {\n-            //Arrange\n-            _room.Address = _address;\n-            var roomController = new RoomController(new LoggerFactory(), _context, null);\n+            mockRepo.Setup(r => r.InsertAsync(It.IsAny<Room.Context.Models.Room>()))\n+                .Returns(Task.CompletedTask);\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            Room.Library.Models.Room newRoom = new Room.Library.Models.Room();\n+            \n+            var result = await ctrl.Post(newRoom);\n \n-            //Act\n+            var roomResult = Assert.IsAssignableFrom<BadRequestObjectResult>(result);\n+\n+            Assert.Equal(400, roomResult.StatusCode);\n+        }\n+         \n+        /// <summary>\n+        /// Posting with invalid state returns 400 status code.\n+        /// </summary>\n+        [Fact]\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Post_InvalidState_Returns400()\n+        {\n+            mockRepo.Setup(r => r.InsertAsync(It.IsAny<Room.Context.Models.Room>()))\n+                .Returns(Task.CompletedTask);\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            Room.Library.Models.Room newRoom = new Room.Library.Models.Room\n+            {\n+                Address = new Room.Library.Models.Address\n+                {\n+                    AddressId = Guid.NewGuid(),\n+                    Address1 = \"5432 Newpost ln\",\n+                    Address2 = \"\",\n+                    City = \"Charlotte\",\n+                    State = \"NC\",\n+                    PostalCode = \"28112\",\n+                    Country = \"Us\"\n+                },\n+                Location = \"Charlotte, NC\",\n+                Vacancy = 3,\n+                Occupancy = 6,\n+                Gender = null\n+            };\n+            \n+            var result = await ctrl.Post(newRoom);\n \n-            var myTask = roomController.Post(_room);\n+            var roomResult = Assert.IsAssignableFrom<BadRequestObjectResult>(result);\n+            \n+            Assert.Equal(400, roomResult.StatusCode);\n+        }\n \n-            var result = await myTask;\n+        /// <summary>\n+        /// Thrown exceptions should return 500 status code.\n+        /// </summary>\n+        [Fact]\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Post_ThrowsException_Returns400()\n+        {\n+            mockRepo.Setup(r => r.InsertAsync(It.IsAny<Room.Context.Models.Room>()))\n+                .ThrowsAsync(new Exception());\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            Room.Library.Models.Room newRoom = new Room.Library.Models.Room\n+            {\n+                Address = new Room.Library.Models.Address\n+                {\n+                    AddressId = addressId1,\n+                    Address1 = \"1234 Test st.\",\n+                    Address2 = \"apt 303\",\n+                    City = \"Tampa\",\n+                    State = \"Ca\",\n+                    PostalCode = \"92646\",\n+                    Country = \"Us\"\n+                },\n+                RoomId = roomId1,\n+                Location = \"Tampa, FL\",\n+                Vacancy = 1,\n+                Occupancy = 2,\n+                Gender = \"M\"\n+            };\n+            \n+            var result = await ctrl.Post(newRoom);\n \n-            var contentResult = result as CreatedAtRouteResult;\n-            Assert.NotNull(contentResult);\n-            var code = (int)contentResult.StatusCode;\n-            Assert.InRange(code,200,299);\n+            var roomResult = Assert.IsAssignableFrom<BadRequestObjectResult>(result);\n+            \n+            Assert.Equal(400, roomResult.StatusCode);\n         }\n \n+        /// <summary>\n+        /// Valid put returns 204 status code.\n+        /// </summary>\n         [Fact]\n-        public async Task TestPostwithInValidModel()\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Put_Valid_Returns204()\n         {\n-            _room.Address = _address;\n-            var roomController = new RoomController(new LoggerFactory(), _context, null);\n-            // make Room model invalid\n-            _room.Location = null;\n+            mockRepo.Setup(r => r.UpdateAsync(It.IsAny<Room.Context.Models.Room>()))\n+                .Callback((Room.Context.Models.Room r)\n+                    => contextRooms.First(c => c.RoomId == r.RoomId).Address = r.Address).Returns(Task.CompletedTask);\n \n-            //Act\n+            mockRepo.Setup(r => r.GetByIdAsync(It.IsAny<Guid>()))\n+                .ReturnsAsync((Guid g) => contextRooms.First(r => r.RoomId == g));\n+            \n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            Room.Library.Models.Room modRoom = new Room.Library.Models.Room\n+            {\n+                RoomId = roomId2,\n+                Location = \"Charlotte, NC\",\n+                Gender = \"M\",\n+                Vacancy = 3\n+            };\n+            \n+            var result = await ctrl.Put(modRoom);\n+            var putResult = Assert.IsAssignableFrom<NoContentResult>(result);\n+            \n+            Assert.Equal(204, putResult.StatusCode);\n+        }\n \n-            var myTask = roomController.Post(_room);\n+        /// <summary>\n+        /// put with null value returns 400 status code.\n+        /// </summary>\n+        [Fact]\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Put_NullInput_Returns400()\n+        {\n+            mockRepo.Setup(r => r.UpdateAsync(It.IsAny<Room.Context.Models.Room>()))\n+                .Callback((Room.Context.Models.Room r)\n+                    => contextRooms.First(c => c.RoomId == r.RoomId).Address = r.Address).Returns(Task.CompletedTask);\n \n-            var result = await myTask;\n+            mockRepo.Setup(r => r.GetByIdAsync(It.IsAny<Guid>()))\n+                .ReturnsAsync((Guid g) => contextRooms.First(r => r.RoomId == g));\n \n-            var contentResult = result as BadRequestObjectResult;\n-            Assert.NotNull(contentResult);\n-            var code = (int)contentResult.StatusCode;\n-            //Invalid input is a client side fault which should yeild a 4xx status code\n-            Assert.InRange(code, 400, 499);\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            Room.Library.Models.Room modRoom = null;\n+            \n+            var result = await ctrl.Put(modRoom);\n+            var putResult = Assert.IsAssignableFrom<BadRequestObjectResult>(result);\n+            \n+            Assert.Equal(400, putResult.StatusCode);\n         }\n \n+        /// <summary>\n+        /// Put with empty room id returns 400 status code.\n+        /// </summary>\n         [Fact]\n-        public async Task TestControllerPut()\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Put_NoRoomId_Returns400()\n         {\n-            //Arrange\n+            mockRepo.Setup(r => r.UpdateAsync(It.IsAny<Room.Context.Models.Room>()))\n+                .Callback((Room.Context.Models.Room r)\n+                    => contextRooms.First(c => c.RoomId == r.RoomId).Address = r.Address).Returns(Task.CompletedTask);\n \n-            var roomController = new RoomController(new LoggerFactory(), _context, null);\n-            _room.Address = _address;\n-            await _context.InsertAsync(ModelMapper.LibraryToContext(_room));\n-            _room.Location = \"Dallas\";\n+            mockRepo.Setup(r => r.GetByIdAsync(It.IsAny<Guid>()))\n+                .ReturnsAsync((Guid g) => contextRooms.First(r => r.RoomId == g));\n \n-            var myTask = roomController.Put(_room);\n-            var result = await myTask;\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            Room.Library.Models.Room modRoom = new Room.Library.Models.Room\n+            {\n+                Location = \"Charlotte, NC\",\n+                Gender = \"M\",\n+                Vacancy = 3\n+            };\n             \n-            var contentResult = result as NoContentResult;\n-            Assert.NotNull(contentResult);\n-            var code = contentResult.StatusCode;\n-            Assert.InRange(code, 200, 299);\n+            var result = await ctrl.Put(modRoom);\n+            var putResult = Assert.IsAssignableFrom<BadRequestObjectResult>(result);\n+            \n+            Assert.Equal(400, putResult.StatusCode);\n+        }\n+\n+        /// <summary>\n+        /// put with wrong Guid returns 404 status code.\n+        /// </summary>\n+        [Fact]\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Put_NotFound_Returns404()\n+        {\n+            mockRepo.Setup(r => r.UpdateAsync(It.IsAny<Room.Context.Models.Room>()))\n+                .Callback((Room.Context.Models.Room r)\n+                    => contextRooms.First(c => c.RoomId == r.RoomId).Address = r.Address).Returns(Task.CompletedTask);\n \n-            var room1 = _context.GetByIdAsync(_room.RoomId).Result;\n+            mockRepo.Setup(r => r.GetByIdAsync(It.IsAny<Guid>()))\n+                .ReturnsAsync((Guid g) => contextRooms.First(r => r.RoomId == g));\n \n-            Assert.Equal(\"Dallas\", room1.Location);\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            Room.Library.Models.Room modRoom = new Room.Library.Models.Room\n+            {\n+                RoomId = Guid.NewGuid(),\n+                Location = \"Charlotte, NC\",\n+                Gender = \"M\",\n+                Vacancy = 3\n+            };\n+            \n+            var result = await ctrl.Put(modRoom);\n+            var putResult = Assert.IsAssignableFrom<NotFoundObjectResult>(result);\n+            \n+            Assert.Equal(404, putResult.StatusCode);\n         }\n \n+        /// <summary>\n+        /// put with a null model returns 500 status code.\n+        /// </summary>\n         [Fact]\n-        public async Task TestControllerPutWithTwoArguments()\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Put_ModelNull_Returns500()\n         {\n-            //Arrange\n+            List<Room.Context.Models.Room> emptyContextRooms = new List<Room.Context.Models.Room>();\n \n-            var roomController = new RoomController(new LoggerFactory(), _context, null);\n-            _room.Address = _address;\n-            await _context.InsertAsync(ModelMapper.LibraryToContext(_room));\n-            _room.Location = \"Dallas\";\n+            Room.Context.Models.Room newRoom = new Room.Context.Models.Room\n+            {\n+                RoomId = newRoomId,\n+                Address = null,\n+                Location = \"Charlotte, NC\",\n+                Vacancy = 3,\n+                Occupancy = 6,\n+                Gender = \"M\"\n+            };\n+            emptyContextRooms.Add(newRoom);\n \n-            var myTask = roomController.Put(_room.RoomId,_room);\n+            mockRepo.Setup(r => r.UpdateAsync(It.IsAny<Room.Context.Models.Room>()))\n+                .Callback((Room.Context.Models.Room r)\n+                    => emptyContextRooms.First(c => c.RoomId == r.RoomId).Address = r.Address).Returns(Task.CompletedTask);\n \n-            var result = await myTask;\n+            mockRepo.Setup(r => r.GetByIdAsync(It.IsAny<Guid>()))\n+                .ReturnsAsync((Guid g) => emptyContextRooms.First(r => r.RoomId == g));\n+\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n             \n-            var contentResult = result as NoContentResult;\n-            Assert.NotNull(contentResult);\n-            var code = contentResult.StatusCode;\n-            Assert.InRange(code, 200, 299);\n+            Room.Library.Models.Room modRoom = new Room.Library.Models.Room\n+            {\n+                RoomId = newRoomId,\n+                Location = \"Charlotte, NC\",\n+                Gender = \"M\",\n+                Vacancy = 3\n+            };\n+            \n+            var result = await ctrl.Put(modRoom);\n+            var putResult = Assert.IsAssignableFrom<StatusCodeResult>(result);\n+            \n+            Assert.Equal(500, putResult.StatusCode);\n+        }\n+\n+        /// <summary>\n+        /// put with no change to model returns 400 status code.\n+        /// </summary>\n+        [Fact]\n+        [Trait(\"Type\", \"Controller\")]\n+        public async Task Put_NoChangeFlag_Returns400()\n+        {\n+            mockRepo.Setup(r => r.UpdateAsync(It.IsAny<Room.Context.Models.Room>()))\n+                .Callback((Room.Context.Models.Room r)\n+                    => contextRooms.First(c => c.RoomId == r.RoomId).Address = r.Address).Returns(Task.CompletedTask);\n+\n+            mockRepo.Setup(r => r.GetByIdAsync(It.IsAny<Guid>()))\n+                .ReturnsAsync((Guid g) => contextRooms.First(r => r.RoomId == g));\n \n-            var room1 = _context.GetByIdAsync(_room.RoomId).Result;\n+            RoomController ctrl = new RoomController(new LoggerFactory(), mockRepo.Object, mockQueue.Object);\n+            \n+            Room.Library.Models.Room modRoom = new Room.Library.Models.Room\n+            {\n+                RoomId = roomId2,\n+            };\n+            \n+            var result = await ctrl.Put(modRoom);\n+            var putResult = Assert.IsAssignableFrom<BadRequestObjectResult>(result);\n \n-            Assert.Equal(\"Dallas\", room1.Location);\n+            \n+            Assert.Equal(400, putResult.StatusCode);\n         }\n \n+        /// <summary>\n+        /// put with incorrect model returns 400 status code.","path":"src/ServiceHub.Room.Testing/Service/RoomControllerTest.cs","position":651,"original_position":651,"commit_id":"8692c50e98994ab253a2228b5d290ce3e82d7f7d","original_commit_id":"8692c50e98994ab253a2228b5d290ce3e82d7f7d","user":{"login":"ajzoell","id":40581945,"node_id":"MDQ6VXNlcjQwNTgxOTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/40581945?v=4","gravatar_id":"","url":"https://api.github.com/users/ajzoell","html_url":"https://github.com/ajzoell","followers_url":"https://api.github.com/users/ajzoell/followers","following_url":"https://api.github.com/users/ajzoell/following{/other_user}","gists_url":"https://api.github.com/users/ajzoell/gists{/gist_id}","starred_url":"https://api.github.com/users/ajzoell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajzoell/subscriptions","organizations_url":"https://api.github.com/users/ajzoell/orgs","repos_url":"https://api.github.com/users/ajzoell/repos","events_url":"https://api.github.com/users/ajzoell/events{/privacy}","received_events_url":"https://api.github.com/users/ajzoell/received_events","type":"User","site_admin":false},"body":"Capitalize \"put\"","created_at":"2018-08-24T01:30:23Z","updated_at":"2018-08-24T01:34:44Z","html_url":"https://github.com/revaturecloud/servicehub-room/pull/41#discussion_r212500811","pull_request_url":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/41","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/comments/212500811"},"html":{"href":"https://github.com/revaturecloud/servicehub-room/pull/41#discussion_r212500811"},"pull_request":{"href":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/41","id":210553230,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNTUzMjMw","html_url":"https://github.com/revaturecloud/servicehub-room/pull/41","diff_url":"https://github.com/revaturecloud/servicehub-room/pull/41.diff","patch_url":"https://github.com/revaturecloud/servicehub-room/pull/41.patch","issue_url":"https://api.github.com/repos/revaturecloud/servicehub-room/issues/41","number":41,"state":"open","locked":false,"title":"Controller tests added and old controller tests updated","user":{"login":"Tallisble","id":22668541,"node_id":"MDQ6VXNlcjIyNjY4NTQx","avatar_url":"https://avatars3.githubusercontent.com/u/22668541?v=4","gravatar_id":"","url":"https://api.github.com/users/Tallisble","html_url":"https://github.com/Tallisble","followers_url":"https://api.github.com/users/Tallisble/followers","following_url":"https://api.github.com/users/Tallisble/following{/other_user}","gists_url":"https://api.github.com/users/Tallisble/gists{/gist_id}","starred_url":"https://api.github.com/users/Tallisble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tallisble/subscriptions","organizations_url":"https://api.github.com/users/Tallisble/orgs","repos_url":"https://api.github.com/users/Tallisble/repos","events_url":"https://api.github.com/users/Tallisble/events{/privacy}","received_events_url":"https://api.github.com/users/Tallisble/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-23T19:34:30Z","updated_at":"2018-08-24T01:34:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20e358d17a7e29fa2e84bf0aa51016096877c9a6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/41/commits","review_comments_url":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/41/comments","review_comment_url":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/comments{/number}","comments_url":"https://api.github.com/repos/revaturecloud/servicehub-room/issues/41/comments","statuses_url":"https://api.github.com/repos/revaturecloud/servicehub-room/statuses/8692c50e98994ab253a2228b5d290ce3e82d7f7d","head":{"label":"revaturecloud:159860605-add-tests-service-hub-room","ref":"159860605-add-tests-service-hub-room","sha":"8692c50e98994ab253a2228b5d290ce3e82d7f7d","user":{"login":"revaturecloud","id":36998744,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2OTk4NzQ0","avatar_url":"https://avatars3.githubusercontent.com/u/36998744?v=4","gravatar_id":"","url":"https://api.github.com/users/revaturecloud","html_url":"https://github.com/revaturecloud","followers_url":"https://api.github.com/users/revaturecloud/followers","following_url":"https://api.github.com/users/revaturecloud/following{/other_user}","gists_url":"https://api.github.com/users/revaturecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/revaturecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revaturecloud/subscriptions","organizations_url":"https://api.github.com/users/revaturecloud/orgs","repos_url":"https://api.github.com/users/revaturecloud/repos","events_url":"https://api.github.com/users/revaturecloud/events{/privacy}","received_events_url":"https://api.github.com/users/revaturecloud/received_events","type":"Organization","site_admin":false},"repo":{"id":131664729,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE2NjQ3Mjk=","name":"servicehub-room","full_name":"revaturecloud/servicehub-room","owner":{"login":"revaturecloud","id":36998744,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2OTk4NzQ0","avatar_url":"https://avatars3.githubusercontent.com/u/36998744?v=4","gravatar_id":"","url":"https://api.github.com/users/revaturecloud","html_url":"https://github.com/revaturecloud","followers_url":"https://api.github.com/users/revaturecloud/followers","following_url":"https://api.github.com/users/revaturecloud/following{/other_user}","gists_url":"https://api.github.com/users/revaturecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/revaturecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revaturecloud/subscriptions","organizations_url":"https://api.github.com/users/revaturecloud/orgs","repos_url":"https://api.github.com/users/revaturecloud/repos","events_url":"https://api.github.com/users/revaturecloud/events{/privacy}","received_events_url":"https://api.github.com/users/revaturecloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/revaturecloud/servicehub-room","description":"the apartment api.","fork":false,"url":"https://api.github.com/repos/revaturecloud/servicehub-room","forks_url":"https://api.github.com/repos/revaturecloud/servicehub-room/forks","keys_url":"https://api.github.com/repos/revaturecloud/servicehub-room/keys{/key_id}","collaborators_url":"https://api.github.com/repos/revaturecloud/servicehub-room/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/revaturecloud/servicehub-room/teams","hooks_url":"https://api.github.com/repos/revaturecloud/servicehub-room/hooks","issue_events_url":"https://api.github.com/repos/revaturecloud/servicehub-room/issues/events{/number}","events_url":"https://api.github.com/repos/revaturecloud/servicehub-room/events","assignees_url":"https://api.github.com/repos/revaturecloud/servicehub-room/assignees{/user}","branches_url":"https://api.github.com/repos/revaturecloud/servicehub-room/branches{/branch}","tags_url":"https://api.github.com/repos/revaturecloud/servicehub-room/tags","blobs_url":"https://api.github.com/repos/revaturecloud/servicehub-room/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/revaturecloud/servicehub-room/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/revaturecloud/servicehub-room/git/refs{/sha}","trees_url":"https://api.github.com/repos/revaturecloud/servicehub-room/git/trees{/sha}","statuses_url":"https://api.github.com/repos/revaturecloud/servicehub-room/statuses/{sha}","languages_url":"https://api.github.com/repos/revaturecloud/servicehub-room/languages","stargazers_url":"https://api.github.com/repos/revaturecloud/servicehub-room/stargazers","contributors_url":"https://api.github.com/repos/revaturecloud/servicehub-room/contributors","subscribers_url":"https://api.github.com/repos/revaturecloud/servicehub-room/subscribers","subscription_url":"https://api.github.com/repos/revaturecloud/servicehub-room/subscription","commits_url":"https://api.github.com/repos/revaturecloud/servicehub-room/commits{/sha}","git_commits_url":"https://api.github.com/repos/revaturecloud/servicehub-room/git/commits{/sha}","comments_url":"https://api.github.com/repos/revaturecloud/servicehub-room/comments{/number}","issue_comment_url":"https://api.github.com/repos/revaturecloud/servicehub-room/issues/comments{/number}","contents_url":"https://api.github.com/repos/revaturecloud/servicehub-room/contents/{+path}","compare_url":"https://api.github.com/repos/revaturecloud/servicehub-room/compare/{base}...{head}","merges_url":"https://api.github.com/repos/revaturecloud/servicehub-room/merges","archive_url":"https://api.github.com/repos/revaturecloud/servicehub-room/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/revaturecloud/servicehub-room/downloads","issues_url":"https://api.github.com/repos/revaturecloud/servicehub-room/issues{/number}","pulls_url":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls{/number}","milestones_url":"https://api.github.com/repos/revaturecloud/servicehub-room/milestones{/number}","notifications_url":"https://api.github.com/repos/revaturecloud/servicehub-room/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/revaturecloud/servicehub-room/labels{/name}","releases_url":"https://api.github.com/repos/revaturecloud/servicehub-room/releases{/id}","deployments_url":"https://api.github.com/repos/revaturecloud/servicehub-room/deployments","created_at":"2018-05-01T01:32:45Z","updated_at":"2018-08-14T19:52:14Z","pushed_at":"2018-08-24T01:20:25Z","git_url":"git://github.com/revaturecloud/servicehub-room.git","ssh_url":"git@github.com:revaturecloud/servicehub-room.git","clone_url":"https://github.com/revaturecloud/servicehub-room.git","svn_url":"https://github.com/revaturecloud/servicehub-room","homepage":null,"size":621,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"revaturecloud:broker","ref":"broker","sha":"729eb2650e76db78340d4510a202cf9208f15c73","user":{"login":"revaturecloud","id":36998744,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2OTk4NzQ0","avatar_url":"https://avatars3.githubusercontent.com/u/36998744?v=4","gravatar_id":"","url":"https://api.github.com/users/revaturecloud","html_url":"https://github.com/revaturecloud","followers_url":"https://api.github.com/users/revaturecloud/followers","following_url":"https://api.github.com/users/revaturecloud/following{/other_user}","gists_url":"https://api.github.com/users/revaturecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/revaturecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revaturecloud/subscriptions","organizations_url":"https://api.github.com/users/revaturecloud/orgs","repos_url":"https://api.github.com/users/revaturecloud/repos","events_url":"https://api.github.com/users/revaturecloud/events{/privacy}","received_events_url":"https://api.github.com/users/revaturecloud/received_events","type":"Organization","site_admin":false},"repo":{"id":131664729,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE2NjQ3Mjk=","name":"servicehub-room","full_name":"revaturecloud/servicehub-room","owner":{"login":"revaturecloud","id":36998744,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2OTk4NzQ0","avatar_url":"https://avatars3.githubusercontent.com/u/36998744?v=4","gravatar_id":"","url":"https://api.github.com/users/revaturecloud","html_url":"https://github.com/revaturecloud","followers_url":"https://api.github.com/users/revaturecloud/followers","following_url":"https://api.github.com/users/revaturecloud/following{/other_user}","gists_url":"https://api.github.com/users/revaturecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/revaturecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revaturecloud/subscriptions","organizations_url":"https://api.github.com/users/revaturecloud/orgs","repos_url":"https://api.github.com/users/revaturecloud/repos","events_url":"https://api.github.com/users/revaturecloud/events{/privacy}","received_events_url":"https://api.github.com/users/revaturecloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/revaturecloud/servicehub-room","description":"the apartment api.","fork":false,"url":"https://api.github.com/repos/revaturecloud/servicehub-room","forks_url":"https://api.github.com/repos/revaturecloud/servicehub-room/forks","keys_url":"https://api.github.com/repos/revaturecloud/servicehub-room/keys{/key_id}","collaborators_url":"https://api.github.com/repos/revaturecloud/servicehub-room/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/revaturecloud/servicehub-room/teams","hooks_url":"https://api.github.com/repos/revaturecloud/servicehub-room/hooks","issue_events_url":"https://api.github.com/repos/revaturecloud/servicehub-room/issues/events{/number}","events_url":"https://api.github.com/repos/revaturecloud/servicehub-room/events","assignees_url":"https://api.github.com/repos/revaturecloud/servicehub-room/assignees{/user}","branches_url":"https://api.github.com/repos/revaturecloud/servicehub-room/branches{/branch}","tags_url":"https://api.github.com/repos/revaturecloud/servicehub-room/tags","blobs_url":"https://api.github.com/repos/revaturecloud/servicehub-room/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/revaturecloud/servicehub-room/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/revaturecloud/servicehub-room/git/refs{/sha}","trees_url":"https://api.github.com/repos/revaturecloud/servicehub-room/git/trees{/sha}","statuses_url":"https://api.github.com/repos/revaturecloud/servicehub-room/statuses/{sha}","languages_url":"https://api.github.com/repos/revaturecloud/servicehub-room/languages","stargazers_url":"https://api.github.com/repos/revaturecloud/servicehub-room/stargazers","contributors_url":"https://api.github.com/repos/revaturecloud/servicehub-room/contributors","subscribers_url":"https://api.github.com/repos/revaturecloud/servicehub-room/subscribers","subscription_url":"https://api.github.com/repos/revaturecloud/servicehub-room/subscription","commits_url":"https://api.github.com/repos/revaturecloud/servicehub-room/commits{/sha}","git_commits_url":"https://api.github.com/repos/revaturecloud/servicehub-room/git/commits{/sha}","comments_url":"https://api.github.com/repos/revaturecloud/servicehub-room/comments{/number}","issue_comment_url":"https://api.github.com/repos/revaturecloud/servicehub-room/issues/comments{/number}","contents_url":"https://api.github.com/repos/revaturecloud/servicehub-room/contents/{+path}","compare_url":"https://api.github.com/repos/revaturecloud/servicehub-room/compare/{base}...{head}","merges_url":"https://api.github.com/repos/revaturecloud/servicehub-room/merges","archive_url":"https://api.github.com/repos/revaturecloud/servicehub-room/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/revaturecloud/servicehub-room/downloads","issues_url":"https://api.github.com/repos/revaturecloud/servicehub-room/issues{/number}","pulls_url":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls{/number}","milestones_url":"https://api.github.com/repos/revaturecloud/servicehub-room/milestones{/number}","notifications_url":"https://api.github.com/repos/revaturecloud/servicehub-room/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/revaturecloud/servicehub-room/labels{/name}","releases_url":"https://api.github.com/repos/revaturecloud/servicehub-room/releases{/id}","deployments_url":"https://api.github.com/repos/revaturecloud/servicehub-room/deployments","created_at":"2018-05-01T01:32:45Z","updated_at":"2018-08-14T19:52:14Z","pushed_at":"2018-08-24T01:20:25Z","git_url":"git://github.com/revaturecloud/servicehub-room.git","ssh_url":"git@github.com:revaturecloud/servicehub-room.git","clone_url":"https://github.com/revaturecloud/servicehub-room.git","svn_url":"https://github.com/revaturecloud/servicehub-room","homepage":null,"size":621,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/41"},"html":{"href":"https://github.com/revaturecloud/servicehub-room/pull/41"},"issue":{"href":"https://api.github.com/repos/revaturecloud/servicehub-room/issues/41"},"comments":{"href":"https://api.github.com/repos/revaturecloud/servicehub-room/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/revaturecloud/servicehub-room/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/revaturecloud/servicehub-room/statuses/8692c50e98994ab253a2228b5d290ce3e82d7f7d"}},"author_association":"NONE"}}
{"actor":{"display_login":"ajzoell"}}