Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Commit

Permalink
Include [Theory] data in xUnit test names
Browse files Browse the repository at this point in the history
This fixes spekt/junit.testlogger#50 by including the xUnit theory data in test names.
  • Loading branch information
hach-que committed Dec 26, 2021
1 parent b5078d1 commit 5dcc780
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/TestLogger/Extensions/XunitTestAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public List<TestResultInfo> TransformResults(
result.Messages.Add(new TestResultMessage("skipReason", skipReason));
}

string displayName = result.Result.DisplayName;

// Add parameters for theories.
if (displayName.Contains("("))
{
result.Method += displayName.Substring(displayName.IndexOf("("));
}

transformedResults.Add(result);
}

Expand Down

0 comments on commit 5dcc780

Please sign in to comment.