Skip to content

Commit 543f0b0

Browse files
committed
Resolve bug trying to add duplicate keys to tests dictionary
Ensure that the given key does not exist prior to trying to add it to the _tests dictionary. Previously this threw an exception and resulted in being unable to run google tests.
1 parent f6c219c commit 543f0b0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

GoogleTestAdapter/TestAdapter/Settings/TestPropertySettingsContainer.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ private void EnsureTestPropertiesMap()
6767
foreach (var t in this.Tests)
6868
{
6969
var key = Path.GetFullPath(t.Command) + ":" + t.Name;
70-
var propertySettings = new TestPropertySettings(t);
71-
_tests.Add(key, propertySettings);
70+
if (!_tests.ContainsKey(key))
71+
{
72+
var propertySettings = new TestPropertySettings(t);
73+
_tests.Add(key, propertySettings);
74+
}
7275
}
7376
}
7477
}

0 commit comments

Comments
 (0)