示例#1
0
        public void ControllerTest_ViewBag()
        {
            // Arrange  - create the controller
            var controller = new ExampleController();

            // Act  - call the action method
            ViewResult result = controller.Index_ViewBag();

            // Assert
            Assert.AreEqual(string.Empty, result.ViewName);
            Assert.AreEqual("Hello", result.ViewBag.Message);
            Assert.IsInstanceOfType(result.ViewBag.Date, typeof(DateTime));
        }