Skip to content

Commit c29a760

Browse files
committed
#110: Visual Studio test explorer cannot filter skipped tests by message
1 parent 5e96160 commit c29a760

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/xunit.runner.visualstudio/Sinks/VsExecutionSink.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,15 @@ void WriteError(
264264
VsTestResult? MakeVsTestResult(
265265
TestOutcome outcome,
266266
ITestSkipped skippedResult) =>
267-
MakeVsTestResult(outcome, skippedResult.TestCase, skippedResult.Test.DisplayName, (double)skippedResult.ExecutionTime, skippedResult.Reason);
267+
MakeVsTestResult(outcome, skippedResult.TestCase, skippedResult.Test.DisplayName, (double)skippedResult.ExecutionTime, errorMessage: skippedResult.Reason);
268268

269269
VsTestResult? MakeVsTestResult(
270270
TestOutcome outcome,
271271
ITestCase testCase,
272272
string displayName,
273273
double executionTime = 0.0,
274-
string? output = null)
274+
string? output = null,
275+
string? errorMessage = null)
275276
{
276277
var vsTestCase = FindTestCase(testCase);
277278
if (vsTestCase == null)
@@ -292,6 +293,9 @@ void WriteError(
292293
if (!string.IsNullOrEmpty(output))
293294
result.Messages.Add(new VsTestResultMessage(VsTestResultMessage.StandardOutCategory, output));
294295

296+
if (!string.IsNullOrEmpty(errorMessage))
297+
result.ErrorMessage = errorMessage;
298+
295299
return result;
296300
}
297301

0 commit comments

Comments
 (0)