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

Commit

Permalink
Include [Theory] parameters in test names
Browse files Browse the repository at this point in the history
This fixes spekt/junit.testlogger#50 by including the Xunit theory parameters in test names.
  • Loading branch information
hach-que committed Dec 26, 2021
1 parent b5078d1 commit 54932a7
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 54932a7

Please sign in to comment.