コード例 #1
0
        public void Index_Action_Test()
        {
            using (var controller = new DummyLanguageSelectorController())
            {
                var viewAction = controller.Index() as ViewResult;

                Assert.IsNotNull(viewAction);
                Assert.IsNotNull(viewAction.Model is ILanguageSelectorModel);
                Assert.IsTrue(viewAction.ViewName == "LanguageSelector.LanguageLinks");
            }
        }
コード例 #2
0
        public void Index_Action_Test_PropertiesToTheViewAreChangedProperly()
        {
            using (var controller = new DummyLanguageSelectorController())
            {
                string template = "custom template";
                controller.TemplateName = template;

                var viewAction = controller.Index() as ViewResult;

                Assert.IsNotNull(viewAction);
                Assert.IsNotNull(viewAction.Model is ILanguageSelectorModel);
                Assert.IsTrue(viewAction.ViewName == "LanguageSelector." + template);
            }
        }