public void TestDetailsView() { var controller = new ShowsController(); var result = controller.Details(2) as ViewResult; Assert.AreEqual("Details", result.ViewName); }
public void Shows_Details() { // Arrange Source source = GetTestSource(); var shows = GetTestShowSet(source); var db = new Mock <IPersonalInformationManagerContext>(); db.Setup(e => e.Shows).Returns(shows); db.Setup(e => e.Shows.Find(It.IsAny <int>())).Returns(GetTestShow(source)); ShowsController controller = new ShowsController(db.Object); // Act ViewResult result = controller.Details(1) as ViewResult; var model = result.Model as PersonalInformationManager.Models.Show; // Assert Assert.IsNotNull(result); Assert.AreEqual(SHOW_TITLE, model.Title); }