예제 #1
0
        public void About()
        {
            // Arrange
            HomeController controller = new HomeController(
                new FakeClock(new DateTime(2013, 6, 27, 10, 0, 0))
            );

            // Act
            ViewResult result = controller.About() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
예제 #2
0
        public void Index_GreetsInTheMorning()
        {
            // Arrange
            HomeController controller = new HomeController(
                new FakeClock(new DateTime(2013, 6, 27, 10, 0, 0))
            );

            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            ViewDataDictionary viewData = result.ViewData;
            Assert.AreEqual("Good morning", viewData["Message"]);
        }