コード例 #1
0
        public void CSGenericControlDirectiveChangesInheritsDirective() {
            var filter = new ViewTypeParserFilter();
            var attributes = new Dictionary<string, string> { { "inherits", "foobar<baz>" } };
            var builder = new MvcBuilder();

            filter.PreprocessDirective("control", attributes);
            filter.ParseComplete(builder);

            Assert.AreEqual(typeof(ViewUserControl).FullName, attributes["inherits"]);
            Assert.AreEqual("foobar<baz>", builder.Inherits);
        }
コード例 #2
0
        public void CSGenericUnknownDirectiveDoesNotChangeInheritsDirective() {
            var filter = new ViewTypeParserFilter();
            var attributes = new Dictionary<string, string> { { "inherits", "foobar<baz>" } };
            var builder = new MvcBuilder();

            filter.PreprocessDirective("unknown", attributes);
            filter.ParseComplete(builder);

            Assert.AreEqual("foobar<baz>", attributes["inherits"]);
            Assert.IsNull(builder.Inherits);
        }
コード例 #3
0
        public void NonGenericMasterDirectiveDoesNotChangeInheritsDirective()
        {
            var filter = new ViewTypeParserFilter();
            var attributes = new Dictionary<string, string> { { "inherits", "foobar" } };
            var builder = new MvcBuilder();

            filter.PreprocessDirective("master", attributes);
            filter.ParseComplete(builder);

            Assert.Equal("foobar", attributes["inherits"]);
            Assert.Null(builder.Inherits);
        }
コード例 #4
0
        public void VBDirectivesAfterPageDirectiveProperlyPreserveInheritsDirective()
        {
            var filter = new ViewTypeParserFilter();
            var pageAttributes = new Dictionary<string, string> { { "inherits", "foobar(of baz)" } };
            var importAttributes = new Dictionary<string, string> { { "inherits", "dummyvalue(of baz)" } };
            var builder = new MvcBuilder();

            filter.PreprocessDirective("page", pageAttributes);
            filter.PreprocessDirective("import", importAttributes);
            filter.ParseComplete(builder);

            Assert.Equal(typeof(ViewPage).FullName, pageAttributes["inherits"]);
            Assert.Equal("foobar(of baz)", builder.Inherits);
        }
コード例 #5
0
        public void VBGenericMasterDirectiveChangesInheritsDirective()
        {
            var filter = new ViewTypeParserFilter();
            var attributes = new Dictionary<string, string> { { "inherits", "foobar(of baz)" } };
            var builder = new MvcBuilder();

            filter.PreprocessDirective("master", attributes);
            filter.ParseComplete(builder);

            Assert.Equal(typeof(ViewMasterPage).FullName, attributes["inherits"]);
            Assert.Equal("foobar(of baz)", builder.Inherits);
        }