Exemple #1
0
        public void CustomActionFilter()
        {
            DemoController controller = new DemoController();

            ContentResult result = controller.CustomActionFilter() as ContentResult;

            Assert.AreEqual("Custom Action Filter Overrides Firing on this Action", result.Content);
        }
Exemple #2
0
        public void AliasedAction()
        {
            DemoController controller = new DemoController();

            ContentResult result = controller.AliasedAction() as ContentResult;

            Assert.AreEqual("This Action is accessible via it's alias - Alias.", result.Content);
        }
Exemple #3
0
        public void ViewBagAction()
        {
            DemoController controller = new DemoController();

            ViewResult result = controller.ViewBagAction() as ViewResult;

            Assert.AreEqual("Adding to the ViewBag", result.ViewBag.TestViewBagProperty);
            Assert.AreEqual(true, result.ViewBag.TestBoolProperty);
        }