Here are the examples of the csharp api Microsoft.VisualStudio.TestPlatform.Extension.Xunit.Xml.TestLogger.XunitXmlSerializer.IsError(TestResultInfo) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
19
Source : XunitXmlSerializer.cs
with MIT License
from spekt
with MIT License
from spekt
private static (XElement element, int total, int preplaceded, int failed, int skipped, int error, TimeSpan time) CreateCollection(IGrouping<string, TestResultInfo> resultsByType, List<TestResultInfo> testResultAsError)
{
var element = new XElement("collection");
int total = 0;
int preplaceded = 0;
int failed = 0;
int skipped = 0;
int error = 0;
var time = TimeSpan.Zero;
foreach (var result in resultsByType)
{
switch (result.Outcome)
{
case TestOutcome.Failed:
if (IsError(result))
{
if (!testResultAsError.Contains(result))
{
error++;
testResultAsError.Add(result);
}
continue;
}
failed++;
break;
case TestOutcome.Preplaceded:
preplaceded++;
break;
case TestOutcome.Skipped:
skipped++;
break;
}
total++;
time += result.Duration;
element.Add(CreateTestElement(result));
}
element.SetAttributeValue("total", total);
element.SetAttributeValue("preplaceded", preplaceded);
element.SetAttributeValue("failed", failed);
element.SetAttributeValue("skipped", skipped);
element.SetAttributeValue("name", $"Test collection for {resultsByType.Key}");
element.SetAttributeValue("time", time.TotalSeconds.ToString("F3", CultureInfo.InvariantCulture));
return (element, total, preplaceded, failed, skipped, error, time);
}