Пример #1
0
        public void RoomType_Put_Should_Return_Not_Found_If_Room_Not_Exists()
        {
            var model = new RoomTypePostViewModel();

            _roomController.Validate(model);
            var response = _roomController.Put(model);

            Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode);
        }
Пример #2
0
        public void RoomType_Create_Should_Return_Created_Room_If_Successfully_Created()
        {
            var model = new RoomTypePostViewModel();

            model.Color = "#ABCDEF";
            model.Name  = "TEST create";

            _roomController.Validate(model);
            var response = _roomController.Post(model);

            Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
        }
Пример #3
0
        public void RoomType_Create_Should_Return_Conflict_If_Room_Already_Exists()
        {
            var model = new RoomTypePostViewModel();

            model.Id    = 1;
            model.Color = "#FFFFFF";
            model.Name  = "-";

            _roomController.Validate(model);
            var response = _roomController.Post(model);

            Assert.AreEqual(HttpStatusCode.Conflict, response.StatusCode);
        }
Пример #4
0
        public void RoomType_Put_Should_Return_Ok_If_Updated_Successfully()
        {
            var model = new RoomTypePostViewModel
            {
                Id     = 1,
                Name   = "TestType",
                IconId = "1"
            };

            _roomController.Validate(model);
            var response = _roomController.Put(model);

            Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
        }