本文整理汇总了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");
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例6: HandleTimeout
protected internal override bool HandleTimeout(TimeoutException te, ITestResults results)
{
results.AddResult("futurePublishDateWarning", NO);
return true;
}
示例7: HandleResult
protected internal override void HandleResult(string homepageHtml, ITestResults results)
{
results.AddResult("futurePublishDateWarning", YES);
}
示例8: HandleTimeout
protected internal override bool HandleTimeout(TimeoutException te, ITestResults results)
{
results.AddResult("supportsPostAsDraft", YES);
return true;
}
示例9: HandleResult
protected internal override void HandleResult(string homepageHtml, ITestResults results)
{
results.AddResult("supportsPostAsDraft", NO);
}