コード例 #1
0
        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);
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
            }
        }