public void TestGetBookingsStatusCode400() { RoomsController objBookingController = new RoomsController(null); IActionResult response = objBookingController.GetBookings(); Assert.AreEqual(400, ((Microsoft.AspNetCore.Mvc.StatusCodeResult)response).StatusCode); }
public void TestGetBookingsStatusCode204() { var mockBookingServiceRepository = new Mock <IRoomBookingServiceRepository>(); DtoRooms objDtoRooms = null; mockBookingServiceRepository.Setup(m => m.GetAllRooms()).Returns(objDtoRooms); RoomsController objBookingController = new RoomsController(mockBookingServiceRepository.Object); IActionResult response = objBookingController.GetBookings(); Assert.AreEqual(204, ((Microsoft.AspNetCore.Mvc.StatusCodeResult)response).StatusCode); }
public void TestGetBookingsStatusCode200() { var mockBookingServiceRepository = new Mock <IRoomBookingServiceRepository>(); DtoRooms objDtoRooms = new DtoRooms(); objDtoRooms.Total = 10; objDtoRooms.Rooms = new System.Collections.Generic.List <WebAppServices.DataModels.Rooms>(); mockBookingServiceRepository.Setup(m => m.GetAllRooms()).Returns(objDtoRooms); RoomsController objBookingController = new RoomsController(mockBookingServiceRepository.Object); IActionResult response = objBookingController.GetBookings(); Assert.AreEqual(200, ((Microsoft.AspNetCore.Mvc.ObjectResult)response).StatusCode); }