public void POSTDeleteHappyCase() { int id = 1; var crossType = new Candidate { Id = 1, GenotypeId = 1 }; var mockRepo = new Mock <IPlantBreedingRepo>(); var controller = new CandidatesController(mockRepo.Object); var response = controller.DeleteConfirmed(id) as RedirectToRouteResult; Assert.IsNotNull(response); Assert.IsNotNull(response.RouteValues); Assert.AreEqual("Index", response.RouteValues["action"]); }