Exemple #1
0
        public void Booking_RedirectToEdit_WhenBookingIsValid()
        {
            // Arrange
            var controller = new HomeController();

            //Act
            var result = controller.Booking(new Booking());

            controller.ModelState.Clear();

            //Assert
            var redirectToActionResult = Assert.IsType <RedirectToActionResult>(result);

            Assert.NotEmpty(redirectToActionResult.RouteValues);
            Assert.Equal("Bookings", redirectToActionResult.ControllerName);
            Assert.Equal("AnimalSelection", redirectToActionResult.ActionName);
        }