Skip to content

Commit

Permalink
Missed this, first attempt at fixing caching bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jnm2 committed Mar 3, 2018
1 parent 428a691 commit 0e777b5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/NUnitTestAdapter/CategoryList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,19 @@ public IEnumerable<string> ProcessTestCaseProperties(XmlNode testNode, bool addT
}

const string explicitTraitName = "Explicit";
// The empty string causes the UI we want.
// If it's null, the explicit trait doesn't show up in Test Explorer.
// If it's not empty, it shows up as “Explicit [value]” in Test Explorer.
const string explicitTraitValue = "";

if (testNode.Attributes?["runstate"]?.Value == "Explicit")
{
if (!testCase.Traits.Any(trait => trait.Name == explicitTraitName))
{
// The empty string causes the UI we want.
// If it's null, the explicit trait doesn't show up in Test Explorer.
// If it's not empty, it shows up as “Explicit [value]” in Test Explorer.
testCase.Traits.Add(new Trait(explicitTraitName, value: string.Empty));
testCase.Traits.Add(new Trait(explicitTraitName, explicitTraitValue));

if (addToCache)
AddTraitsToCache(traitsCache, key, explicitTraitName, explicitTraitValue);
}
}

Expand Down

0 comments on commit 0e777b5

Please sign in to comment.