public void FixUpClassUserControlTest() { CodeTypeDeclaration type; CodeCastExpression cast; GetAspxClass(out type, out cast, typeof(WebUserControlSurrogate)); WebPageSurrogateControlBuilder.FixUpClass(type, "/test/test.ascx"); Assert.AreEqual(typeof(UserControl).FullName, cast.TargetType.BaseType); }
public void FixUpClassVirtualPathTest() { Utils.RunInSeparateAppDomain(() => { var vpath = "/WebSite1/index.aspq"; var contents = "<%@ Page Language=C# %>"; Utils.SetupVirtualPathInAppDomain(vpath, contents); new WebPageSurrogateControlBuilderTest().FixUpClassTest(type => WebPageSurrogateControlBuilder.FixUpClass(type, vpath)); }); }
public void FixUpClassDefaultApplicationBaseTypeTest() { Utils.RunInSeparateAppDomain(() => { var baseTypeField = typeof(PageParser).GetField("s_defaultApplicationBaseType", BindingFlags.Static | BindingFlags.NonPublic); baseTypeField.SetValue(null, typeof(WebPageHttpApplication)); var pageType = new WebPageSurrogateControlBuilderTest().FixUpClassTest(type => WebPageSurrogateControlBuilder.FixUpClass(type, Language.CSharp)); var properties = pageType.Members.OfType <CodeMemberProperty>().ToList(); var prop = properties[0]; Assert.AreEqual(typeof(WebPageHttpApplication).FullName, prop.Type.BaseType); }); }
public void FixUpClassLanguageTest() { FixUpClassTest(type => WebPageSurrogateControlBuilder.FixUpClass(type, Language.CSharp)); }
public void FixUpClassNull() { WebPageSurrogateControlBuilder.FixUpClass(null, null); }