public void POSTDeleteHappyCase() { int id = 12; var Genotype = new Genotype { Id = 12, GivenName = "bananas" }; var mockRepo = new Mock <IPlantBreedingRepo>(); mockRepo.Setup(m => m.GetGenotype(12)).Returns(Genotype); var controller = new DefaultController(mockRepo.Object); var response = controller.DeleteConfirmed(id) as RedirectToRouteResult; Assert.IsNotNull(response); Assert.IsNotNull(response.RouteValues); Assert.AreEqual("Index", response.RouteValues["action"]); }