diff options
author | Keting Yang <ketyang@microsoft.com> | 2019-12-09 21:19:58 +0300 |
---|---|---|
committer | Keting Yang <ketyang@microsoft.com> | 2019-12-09 21:19:58 +0300 |
commit | c00ffa7127439b5f81651297c26e5e948f06d43d (patch) | |
tree | 671c5cde16bab3d2ff7c446506e96c3c6df44815 /main/src/addins/MonoDevelop.UnitTesting | |
parent | 0e3a84d98c8ffe24ff29a3c4ac83d24b824ab176 (diff) |
Add test case for unit test nesting
Diffstat (limited to 'main/src/addins/MonoDevelop.UnitTesting')
-rw-r--r-- | main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/VsTestUnitTestTests.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/VsTestUnitTestTests.cs b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/VsTestUnitTestTests.cs index a0748216f1..df37e68ea1 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/VsTestUnitTestTests.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests/VsTestUnitTestTests.cs @@ -97,6 +97,24 @@ namespace MonoDevelop.UnitTesting.Tests Assert.AreEqual ("Namespace.MyTest.Test1", test.TestSourceCodeDocumentId); } + /// <summary> + /// VSTS Bug 901156: [Feedback] Weird nesting in "Unit Tests" explorer/window. + /// </summary> + [Test] + public void TestVSTS901156 () + { + var parentNamespace = new VsTestNamespaceTestGroup (null, null, null, string.Empty); + var test1 = new MyVsTestUnitTest ("Namespace.childNamespace.TestClass.TestMethod1", "Namespace.childNamespace", "TestClass"); + var test2 = new MyVsTestUnitTest ("Namespace.childNamespace.TestClass.TestMethod2", "Namespace.childNamespace", "TestClass"); + parentNamespace.AddTest (test1); + parentNamespace.AddTest (test2); + var currentNamespace = (VsTestNamespaceTestGroup)parentNamespace.Tests [0]; + var currentClass = (VsTestTestClass)currentNamespace.Tests [0]; + Assert.AreEqual (currentNamespace.FixtureTypeNamespace, "Namespace.childNamespace"); + Assert.AreEqual (currentNamespace.Tests.Count, 1); + Assert.AreEqual (currentClass.Tests.Count, 2); + } + class MyVsTestUnitTest : VsTestUnitTest { public MyVsTestUnitTest (string displayName, string fixtureTypeNamespace, string fixtureTypeName) : base(displayName) |