Esempio n. 1
0
        public void Admin_AddHotel_NullValuePassing()
        {
            //Arrange
            AdminController adminController = new AdminController()
            {
                Request = new HttpRequestMessage()
                {
                    Properties = { { HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration() } }
                }
            };
            CityHotelDetailsFromAdmin hotel = new CityHotelDetailsFromAdmin();

            //Act
            var response = adminController.AddHotel(hotel);

            //Assert
            Assert.AreEqual(HttpStatusCode.Conflict, response.StatusCode);
        }
Esempio n. 2
0
        public void Admin_AddHotel_WrongDetails()
        {
            //Arrange
            AdminController adminController = new AdminController()
            {
                Request = new HttpRequestMessage()
                {
                    Properties = { { HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration() } }
                }
            };
            CityHotelDetailsFromAdmin hotel = new CityHotelDetailsFromAdmin();

            hotel.cityId       = 34;
            hotel.hotelName    = "Izzy Cozy Hotel";
            hotel.hotelAddress = "143, Patia Road, Near Big Baazar";
            hotel.totalRooms   = 5;


            //Act
            var response = adminController.AddHotel(hotel);

            //Assert
            Assert.AreEqual(HttpStatusCode.Conflict, response.StatusCode);
        }