Esempio n. 1
0
        public void GetLanguageFromTextPositiveTest()
        {
            Assert.AreEqual(Language.VisualBasic, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@  Page   %>  csharp c# cs  "));
            Assert.AreEqual(Language.VisualBasic, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  vB    '   %>  csharp c# cs  "));
            Assert.AreEqual(Language.VisualBasic, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language=\"  vb    \"   %>  csharp c# cs  "));
            Assert.AreEqual(Language.VisualBasic, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  Vb    '   %>  csharp c# cs  "));
            Assert.AreEqual(Language.VisualBasic, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  vB    '   %>  csharp c# cs  "));
            Assert.AreEqual(Language.VisualBasic, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  vBs    '   %>  csharp c# cs  "));
            Assert.AreEqual(Language.VisualBasic, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  vBscript    '   %>  csharp c# cs  "));
            Assert.AreEqual(Language.VisualBasic, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  vBscript    '   %>  csharp c# cs  "));
            Assert.AreEqual(Language.VisualBasic, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  vIsuaLBasic    '   %>  csharp c# cs  "));

            Assert.AreEqual(Language.CSharp, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  c#    '   %>  vb vbs visualbasic vbscript  "));
            Assert.AreEqual(Language.CSharp, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  cS    '   %>  vb vbs visualbasic vbscript  "));
            Assert.AreEqual(Language.CSharp, WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  cShaRP    '   %>  vb vbs visualbasic vbscript  "));
        }
Esempio n. 2
0
 public void GetLanguageFromTextNegativeTest()
 {
     ExceptionAssert.Throws <HttpException>(() =>
                                            WebPageSurrogateControlBuilder.GetLanguageFromText("<%@   Page   Language='  zxc'   %>  vb vbs visualbasic vbscript  "),
                                            String.Format(WebPageResources.WebPage_InvalidLanguage, "zxc"));
 }