public void Details_BookingExists_ReturnsViewResultWithBooking() { // Act var result = controller.Details(1) as ViewResult; var book = result.Model as Booking; var bookId = book.Id; // Assert Assert.InRange <int>(bookId, 1, 2); }
public void DetailsTest() { Booking booking = new Booking() { Guests = new List <Guest>(), Room = new Room(), Date = new DateTime(2019, 6, 12), Price = 200, }; _mockBookingRepo.Setup(x => x.FindBooking(1)).Returns(booking); var result = _bookingController.Details(1) as ViewResult; Assert.AreEqual(booking, result.Model); }