本文整理汇总了C#中TestResult.setOutcome方法的典型用法代码示例。如果您正苦于以下问题:C# TestResult.setOutcome方法的具体用法?C# TestResult.setOutcome怎么用?C# TestResult.setOutcome使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestResult
的用法示例。
在下文中一共展示了TestResult.setOutcome方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessSingleTestNode
internal TestResult ProcessSingleTestNode(XmlNode theResultNode)
{
TestResult testResult = new TestResult();
//Get the name and outcome of the test
Regex match = new Regex("Environment='[A-Za-z]*'");
Match environmentName = match.Match(theResultNode.InnerText);
if (environmentName != Match.Empty)
{
string[] splitString = environmentName.ToString().Split('=');
if (splitString.Length == 2)
{
testResult.ExecutionEnvironment = splitString[1].Replace("'", "");
}
}
testResult.TestName = theResultNode.Attributes["testName"].Value;
testResult.setOutcome(theResultNode.Attributes["outcome"].Value);
//Capture the end time and duration
testResult.ExecutionCompletionDateTime = Convert.ToDateTime(theResultNode.Attributes["endTime"].Value);
testResult.ExecutionDuration = TimeSpan.Parse(theResultNode.Attributes["duration"].Value);
//Build the first part of the comment
StringBuilder comment = new StringBuilder();
comment.Append("\r\n");
comment.Append("Test " + theResultNode.Attributes["outcome"].Value.ToUpper());
comment.Append(" on " + theResultNode.Attributes["computerName"].Value);
comment.Append(" at " + testResult.ExecutionCompletionDateTime.ToShortDateString() + " " + testResult.ExecutionCompletionDateTime.ToShortTimeString());
comment.Append("\r\n");
comment.Append("Duration: " + testResult.ExecutionDuration.Minutes + " min " + testResult.ExecutionDuration.Seconds + " sec");
testResult.ExecutionComments = comment.ToString();
testResult.ComputerName = theResultNode.Attributes["computerName"].Value;
return testResult;
}