public IEnumerable <UnitTest> BuildTestInfo(VsTestProjectTestSuite projectTestSuite) { tests.Sort(OrderByName); var parentNamespace = new VsTestNamespaceTestGroup(projectTestSuite, null, projectTestSuite.Project, string.Empty); parentNamespace.AddTests(tests); return(parentNamespace.Tests); }
public VsTestNamespaceTestGroup(IVsTestTestRunner testRunner, UnitTestGroup parent, Project project, string name) : base(name) { this.Project = project; currentNamespace = this; this.testRunner = testRunner; if (parent == null || String.IsNullOrEmpty(parent.FixtureTypeNamespace)) { FixtureTypeNamespace = name; } else { FixtureTypeNamespace = parent.FixtureTypeNamespace + "." + name; } }
internal void AddTest(VsTestUnitTest VsTestTest) { string childNamespace = VsTestTest.FixtureTypeNamespace; if (currentNamespace == null || currentNamespace.Name != childNamespace) { currentNamespace = new VsTestNamespaceTestGroup(testRunner, currentNamespace, Project, childNamespace); currentNamespace.AddTest(VsTestTest); Tests.Add(currentNamespace); } else { if (currentNamespace.currentClass == null || currentNamespace.currentClass.FixtureTypeName != VsTestTest.FixtureTypeName) { currentNamespace.currentClass = new VsTestTestClass(testRunner, Project, VsTestTest); currentNamespace.Tests.Add(currentNamespace.currentClass); } currentNamespace.currentClass.Tests.Add(VsTestTest); } }
void AddTest(VsTestUnitTest VsTestTest) { string childNamespace = VsTestTest.GetChildNamespace(FixtureTypeNamespace); if (string.IsNullOrEmpty(childNamespace)) { if (currentClass == null || currentClass.FixtureTypeName != VsTestTest.FixtureTypeName) { currentClass = new VsTestTestClass(testRunner, Project, VsTestTest.FixtureTypeName); Tests.Add(currentClass); } currentClass.Tests.Add(VsTestTest); } else if (currentNamespace.Name == childNamespace) { currentNamespace.AddTest(VsTestTest); } else { currentNamespace = new VsTestNamespaceTestGroup(testRunner, currentNamespace, Project, childNamespace); currentNamespace.AddTest(VsTestTest); Tests.Add(currentNamespace); } }