public void Delete_Success_ReturnsARedirectToActionResut() { // Arrange var paymentId = 1; var testPayment = new PaymentViewModel() { Id = paymentId }; var paymentsRepo = new Mock <IPaymentService>(); var guestsRepo = new Mock <IGuestService>(); var reservationsRepo = new Mock <IReservationService>(); paymentsRepo.Setup(g => g.DeletePayment(paymentId)); var controller = new PaymentController(paymentsRepo.Object, guestsRepo.Object, reservationsRepo.Object); // Act var result = controller.DeleteConfirmed(paymentId); // Assert var redirectToActionResult = result as RedirectToActionResult; Assert.AreEqual("Index", redirectToActionResult.ActionName); }