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.Equal(typeof(ViewUserControl).FullName, attributes["inherits"]); Assert.Equal("foobar<baz>", builder.Inherits); }
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.Equal("foobar<baz>", attributes["inherits"]); Assert.Null(builder.Inherits); }
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); }
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.AreEqual("foobar", attributes["inherits"]); Assert.IsNull(builder.Inherits); }
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); }