当前位置: 首页>>代码示例>>C#>>正文


C# ITestResults.AddResult方法代码示例

本文整理汇总了C#中ITestResults.AddResult方法的典型用法代码示例。如果您正苦于以下问题:C# ITestResults.AddResult方法的具体用法?C# ITestResults.AddResult怎么用?C# ITestResults.AddResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITestResults的用法示例。


在下文中一共展示了ITestResults.AddResult方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleResult

        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");
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:27,代码来源:TitleEncodingTest.cs

示例2: HandleResult

 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);
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:7,代码来源:SupportsMultipleCategoriesTest.cs

示例3: HandleContentResult

 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);
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:9,代码来源:SupportsEmbedsTest.cs

示例4: HandleContentResult

 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);
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:12,代码来源:SupportsEmbedsTest.cs

示例5: DoTest

        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);
            }
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:21,代码来源:SupportsEmptyTitlesTest.cs

示例6: HandleTimeout

 protected internal override bool HandleTimeout(TimeoutException te, ITestResults results)
 {
     results.AddResult("futurePublishDateWarning", NO);
     return true;
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:5,代码来源:SupportsFuturePostTest.cs

示例7: HandleResult

 protected internal override void HandleResult(string homepageHtml, ITestResults results)
 {
     results.AddResult("futurePublishDateWarning", YES);
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:4,代码来源:SupportsFuturePostTest.cs

示例8: HandleTimeout

 protected internal override bool HandleTimeout(TimeoutException te, ITestResults results)
 {
     results.AddResult("supportsPostAsDraft", YES);
     return true;
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:5,代码来源:SupportsPostAsDraftTest.cs

示例9: HandleResult

 protected internal override void HandleResult(string homepageHtml, ITestResults results)
 {
     results.AddResult("supportsPostAsDraft", NO);
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:4,代码来源:SupportsPostAsDraftTest.cs


注:本文中的ITestResults.AddResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。