示例#1
0
        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);
        }
示例#2
0
        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));
            });
        }
示例#3
0
 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);
     });
 }
示例#4
0
 public void FixUpClassLanguageTest()
 {
     FixUpClassTest(type =>
                    WebPageSurrogateControlBuilder.FixUpClass(type, Language.CSharp));
 }
示例#5
0
 public void FixUpClassNull()
 {
     WebPageSurrogateControlBuilder.FixUpClass(null, null);
 }