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 authored Dec 26, 2021
1 parent b5078d1 commit f04de2e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/TestLogger/Extensions/XunitTestAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,18 @@ 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);
}

return transformedResults;
}
}
}
}

0 comments on commit f04de2e

Please sign in to comment.