protected internal override void HandleResult(string homepageHtml, ITestResults results)
        {
            Regex regex = new Regex(Regex.Escape(guid1) + "(.*?)" + Regex.Escape(guid2));

            SimpleHtmlParser parser = new SimpleHtmlParser(homepageHtml);
            for (Element e = parser.Next(); e != null; e = parser.Next())
            {
                if (e is Text)
                {
                    Match m = regex.Match(e.ToString());
                    if (m.Success)
                    {
                        string str = m.Groups[1].Value;
                        if (str == HtmlUtils.EscapeEntities(TEST_STRING))
                            results.AddResult("requiresHtmlTitles", YES);
                        else if (str == HtmlUtils.EscapeEntities(HtmlUtils.EscapeEntities(TEST_STRING)))
                            results.AddResult("requiresHtmlTitles", NO);
                        else
                            results.AddResult("requiresHtmlTitles", "[ERROR] (value was: " + str + ")");

                        return;
                    }
                }
            }

            throw new InvalidOperationException("Title encoding test failed--title was not detected");
        }
示例#2
0
        public override void DoTest(BlogRunner.Core.Config.Blog blog, OpenLiveWriter.Extensibility.BlogClient.IBlogClient blogClient, ITestResults results)
        {
            BlogPost post = new BlogPost();

            post.Contents = "foo";
            post.Title    = "";

            string      etag;
            XmlDocument remotePost;

            try
            {
                string newPostId = blogClient.NewPost(blog.BlogId, post, null, true, out etag, out remotePost);
                results.AddResult("supportsEmptyTitles", YES);

                if (CleanUpPosts)
                {
                    blogClient.DeletePost(blog.BlogId, newPostId, true);
                }
            }
            catch
            {
                results.AddResult("supportsEmptyTitles", NO);
            }
        }
        protected internal override void HandleResult(string homepageHtml, ITestResults results)
        {
            Regex regex = new Regex(Regex.Escape(guid1) + "(.*?)" + Regex.Escape(guid2));

            SimpleHtmlParser parser = new SimpleHtmlParser(homepageHtml);

            for (Element e = parser.Next(); e != null; e = parser.Next())
            {
                if (e is Text)
                {
                    Match m = regex.Match(e.ToString());
                    if (m.Success)
                    {
                        string str = m.Groups[1].Value;
                        if (str == HtmlUtils.EscapeEntities(TEST_STRING))
                        {
                            results.AddResult("requiresHtmlTitles", YES);
                        }
                        else if (str == HtmlUtils.EscapeEntities(HtmlUtils.EscapeEntities(TEST_STRING)))
                        {
                            results.AddResult("requiresHtmlTitles", NO);
                        }
                        else
                        {
                            results.AddResult("requiresHtmlTitles", "[ERROR] (value was: " + str + ")");
                        }

                        return;
                    }
                }
            }

            throw new InvalidOperationException("Title encoding test failed--title was not detected");
        }
 protected internal override void HandleResult(OpenLiveWriter.Extensibility.BlogClient.BlogPost blogPost, ITestResults results)
 {
     if (blogPost.Categories.Length == 2)
         results.AddResult("supportsMultipleCategories", YES);
     else
         results.AddResult("supportsMultipleCategories", NO);
 }
 public override void HandleContentResult(string result, ITestResults results)
 {
     if (result == null)
         throw new InvalidOperationException("Embed test markers were not found!");
     else if (result.ToLowerInvariant().Contains("<embed"))
         results.AddResult("supportsEmbeds", YES);
     else
         results.AddResult("supportsEmbeds", NO);
 }
 protected internal override void HandleResult(OpenLiveWriter.Extensibility.BlogClient.BlogPost blogPost, ITestResults results)
 {
     if (blogPost.Categories.Length == 2)
     {
         results.AddResult("supportsMultipleCategories", YES);
     }
     else
     {
         results.AddResult("supportsMultipleCategories", NO);
     }
 }
 public override void HandleContentResult(string result, ITestResults results)
 {
     if (result == null)
     {
         Debug.Fail("Embeds gone");
         results.AddResult("supportsEmbeds", "Unknown");
     }
     else if (result.ToLowerInvariant().Contains("<embed"))
         results.AddResult("supportsEmbeds", YES);
     else
         results.AddResult("supportsEmbeds", NO);
 }
 public override void HandleContentResult(string result, ITestResults results)
 {
     if (result == null)
     {
         throw new InvalidOperationException("Embed test markers were not found!");
     }
     else if (result.ToLowerInvariant().Contains("<embed"))
     {
         results.AddResult("supportsEmbeds", YES);
     }
     else
     {
         results.AddResult("supportsEmbeds", NO);
     }
 }
 public override void HandleContentResult(string result, ITestResults results)
 {
     if (result == null)
     {
         Debug.Fail("Scripts gone");
         results.AddResult("supportsScripts", "Unknown");
     }
     else if (result.ToLowerInvariant().Contains("script"))
     {
         results.AddResult("supportsScripts", YES);
     }
     else
     {
         results.AddResult("supportsScripts", NO);
     }
 }
        public override void DoTest(BlogRunner.Core.Config.Blog blog, OpenLiveWriter.Extensibility.BlogClient.IBlogClient blogClient, ITestResults results)
        {
            BlogPost post = new BlogPost();
            post.Contents = "foo";
            post.Title = "";

            string etag;
            XmlDocument remotePost;
            try
            {
                string newPostId = blogClient.NewPost(blog.BlogId, post, null, true, out etag, out remotePost);
                results.AddResult("supportsEmptyTitles", YES);

                if (CleanUpPosts)
                    blogClient.DeletePost(blog.BlogId, newPostId, true);
            }
            catch
            {
                results.AddResult("supportsEmptyTitles", NO);
            }
        }
示例#11
0
 protected internal override void HandleResult(string homepageHtml, ITestResults results)
 {
     results.AddResult("futurePublishDateWarning", YES);
 }
示例#12
0
 protected internal override bool HandleTimeout(TimeoutException te, ITestResults results)
 {
     results.AddResult("supportsPostAsDraft", YES);
     return(true);
 }
示例#13
0
 protected internal override void HandleResult(string homepageHtml, ITestResults results)
 {
     results.AddResult("supportsPostAsDraft", NO);
 }
 protected internal override bool HandleTimeout(TimeoutException te, ITestResults results)
 {
     results.AddResult("supportsPostAsDraft", YES);
     return true;
 }
 protected internal override void HandleResult(string homepageHtml, ITestResults results)
 {
     results.AddResult("futurePublishDateWarning", YES);
 }
示例#16
0
 protected internal override bool HandleTimeout(TimeoutException te, ITestResults results)
 {
     results.AddResult("futurePublishDateWarning", NO);
     return(true);
 }
 protected internal override bool HandleTimeout(TimeoutException te, ITestResults results)
 {
     results.AddResult("futurePublishDateWarning", NO);
     return true;
 }
 protected internal override void HandleResult(string homepageHtml, ITestResults results)
 {
     results.AddResult("supportsPostAsDraft", NO);
 }