Exemplo n.º 1
0
        protected override void OnCreateTests()
        {
            if (testInfo.Tests == null)
            {
                return;
            }

            foreach (NunitTestInfo test in testInfo.Tests)
            {
                if (test.Tests != null)
                {
                    var newTest = new NUnitTestSuite(rootSuite, test);
                    newTest.FixtureTypeName      = test.FixtureTypeName;
                    newTest.FixtureTypeNamespace = test.FixtureTypeNamespace;

                    ChildStatus(test, out bool isNamespace, out bool hasClassAsChild);

                    if (isNamespace)
                    {
                        var forceLoad = newTest.Tests;
                        foreach (var child in newTest.ChildNamespaces)
                        {
                            child.Title = newTest.Title + "." + child.Title;
                            childNamespaces.Add(child);
                        }
                        if (hasClassAsChild)
                        {
                            childNamespaces.Add(newTest);
                        }
                    }
                    else
                    {
                        Tests.Add(newTest);
                    }
                }
                else
                {
                    var newTest = new NUnitTestCase(rootSuite, test, ClassName);
                    newTest.FixtureTypeName      = test.FixtureTypeName;
                    newTest.FixtureTypeNamespace = test.FixtureTypeNamespace;
                    Tests.Add(newTest);
                }
            }
        }
Exemplo n.º 2
0
        protected override void OnCreateTests()
        {
            if (testInfo.Tests == null)
            {
                return;
            }

            foreach (NunitTestInfo test in testInfo.Tests)
            {
                UnitTest newTest;
                if (test.Tests != null)
                {
                    newTest = new NUnitTestSuite(rootSuite, test);
                }
                else
                {
                    newTest = new NUnitTestCase(rootSuite, test, ClassName);
                }
                newTest.FixtureTypeName      = test.FixtureTypeName;
                newTest.FixtureTypeNamespace = test.FixtureTypeNamespace;
                Tests.Add(newTest);
            }
        }
 void FillTests(NunitTestInfo ti)
 {
     if (ti.Tests == null)
     {
         return;
     }
     foreach (NunitTestInfo test in ti.Tests)
     {
         UnitTest newTest;
         if (test.Tests != null)
         {
             newTest = new NUnitTestSuite(this, test);
         }
         else
         {
             newTest = new NUnitTestCase(this, test, test.PathName);
         }
         newTest.FixtureTypeName      = test.FixtureTypeName;
         newTest.FixtureTypeNamespace = test.FixtureTypeNamespace;
         Tests.Add(newTest);
     }
     oldList = new UnitTest [Tests.Count];
     Tests.CopyTo(oldList, 0);
 }