Use the unique ID of test cases instead of display name for lookups

Fixes a crash when attempting to run the StyleCop Analyzers test suite.
This commit is contained in:
Sam Harwell
2017-03-25 12:25:49 -05:00
parent 80a52c0f30
commit 412c9b78fe
6 changed files with 32 additions and 20 deletions
+3 -2
View File
@@ -594,7 +594,7 @@ namespace Xunit.Runner.Wpf.ViewModel
{
if (testCase.AssemblyFileName == assemblyFileName)
{
builder.Add(testCase.DisplayName);
builder.Add(testCase.UniqueID);
}
}
@@ -660,6 +660,7 @@ namespace Xunit.Runner.Wpf.ViewModel
var testCaseViewModel = new TestCaseViewModel(
testCase.DisplayName,
testCase.UniqueID,
testCase.SkipReason,
testCase.AssemblyPath,
traitWorkerList);
@@ -679,7 +680,7 @@ namespace Xunit.Runner.Wpf.ViewModel
foreach (var result in testResultData)
{
var testCase = this.runningTests.Single(x => x.DisplayName == result.TestCaseDisplayName);
var testCase = this.runningTests.Single(x => x.UniqueID == result.TestCaseUniqueID);
testCase.State = result.TestState;
TestsCompleted++;