diff options
author | Keting Yang <ketyang@microsoft.com> | 2019-12-04 00:52:56 +0300 |
---|---|---|
committer | Keting Yang <ketyang@microsoft.com> | 2019-12-04 00:52:56 +0300 |
commit | 59698ce4056b0c8d2db5b84d2b60409b31dfe51a (patch) | |
tree | 977040d3f34a0af89353a71592f1dd5f0712b00e /main/src/addins/MonoDevelop.UnitTesting | |
parent | a5c735c46d437e929b2def822102ecd838efa662 (diff) |
Fix the nesting logic
Diffstat (limited to 'main/src/addins/MonoDevelop.UnitTesting')
-rw-r--r-- | main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.VsTest/VsTestNamespaceTestGroup.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.VsTest/VsTestNamespaceTestGroup.cs b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.VsTest/VsTestNamespaceTestGroup.cs index 1f0fe79440..5092b235b7 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.VsTest/VsTestNamespaceTestGroup.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.VsTest/VsTestNamespaceTestGroup.cs @@ -66,16 +66,16 @@ namespace MonoDevelop.UnitTesting.VsTest { string childNamespace = VsTestTest.FixtureTypeNamespace; - if(currentNamespace.Name != childNamespace) { + if (currentNamespace == null || currentNamespace.Name != childNamespace) { currentNamespace = new VsTestNamespaceTestGroup (testRunner, currentNamespace, Project, childNamespace); currentNamespace.AddTest (VsTestTest); Tests.Add (currentNamespace); } else { - if (currentClass == null || currentClass.FixtureTypeName != VsTestTest.FixtureTypeName) { - currentClass = new VsTestTestClass (testRunner, Project, VsTestTest); - Tests.Add (currentClass); + if (currentNamespace.currentClass == null || currentNamespace.currentClass.FixtureTypeName != VsTestTest.FixtureTypeName) { + currentNamespace.currentClass = new VsTestTestClass (testRunner, Project, VsTestTest); + currentNamespace.Tests.Add (currentNamespace.currentClass); } - currentClass.Tests.Add (VsTestTest); + currentNamespace.currentClass.Tests.Add (VsTestTest); } } |