public void DirectiveCompletion()
        {
            var provider = AspNetTesting.CreateProvider(@"<%@ $ %>", ".aspx", false);

            Assert.IsNotNull(provider);
            Assert.AreEqual(9, provider.Count);
            Assert.IsNotNull(provider.Find("Page"));
            Assert.IsNotNull(provider.Find("Register"));

            provider = AspNetTesting.CreateProvider(@"<%@ $ %>", ".master", false);
            Assert.IsNotNull(provider);
            Assert.AreEqual(7, provider.Count);
            Assert.IsNotNull(provider.Find("Master"));
            Assert.IsNotNull(provider.Find("Register"));

            provider = AspNetTesting.CreateProvider(@"<%@ $ %>", ".ascx", false);
            Assert.IsNotNull(provider);
            Assert.AreEqual(7, provider.Count);
            Assert.IsNotNull(provider.Find("Control"));
            Assert.IsNotNull(provider.Find("Register"));

            provider = AspNetTesting.CreateProvider(@"<%@$ %>", ".aspx", false);
            Assert.IsNull(provider);

            provider = AspNetTesting.CreateProvider(@"<%@   $ %>", ".aspx", false);
            Assert.IsNull(provider);
        }
Exemplo n.º 2
0
        void HeadBodyCompletion(bool ctrlSpace)
        {
            const string test     = @"<%@ Page Language=""C#"" %>
<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Strict//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"">
<html>
<$";
            var          provider = AspNetTesting.CreateProvider(test, ".aspx", ctrlSpace);

            Assert.IsNotNull(provider);
            Assert.IsNotNull(provider.Find("head"));
            Assert.IsNotNull(provider.Find("body"));
            Assert.IsNotNull(provider.Find("/html>"));
            Assert.IsNull(provider.Find("div"));
            Assert.IsNotNull(provider.Find("asp:Button"));
        }
        public void DirectiveAttributeCtrlSpaceCompletion()
        {
            var provider = AspNetTesting.CreateProvider(@"<%@ Page $ %>", ".aspx", true);

            Assert.IsNotNull(provider);
            Assert.AreEqual(41, provider.Count);
            Assert.IsNotNull(provider.Find("StyleSheetTheme"));
            Assert.IsNotNull(provider.Find("Inherits"));

            provider = AspNetTesting.CreateProvider(@"<%@ Master $ %>", ".master", true);
            Assert.IsNotNull(provider);
            Assert.AreEqual(18, provider.Count);
            Assert.IsNull(provider.Find("StyleSheetTheme"));
            Assert.IsNotNull(provider.Find("MasterPageFile"));
            Assert.IsNotNull(provider.Find("Inherits"));

            provider = AspNetTesting.CreateProvider(@"<%@ Control $ %>", ".ascx", true);
            Assert.IsNotNull(provider);
            Assert.AreEqual(17, provider.Count);
            Assert.IsNull(provider.Find("StyleSheetTheme"));
            Assert.IsNotNull(provider.Find("Inherits"));
        }