예제 #1
0
        public void TestDetailsView()
        {
            var controller = new ShowsController();
            var result     = controller.Details(2) as ViewResult;

            Assert.AreEqual("Details", result.ViewName);
        }
예제 #2
0
        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);
        }