Пример #1
0
    private static void addTestSuiteToMyTest(NUnit.Framework.Interfaces.ITest testSuite, System.Collections.Generic.List <MyTest> newMyTests)
    {
        var index = AltUnityTesterEditor.EditorConfiguration.MyTests.FirstOrDefault(a => a.TestName.Equals(testSuite.FullName));

        if (index == null)
        {
            if (testSuite.Parent == null)
            {
                newMyTests.Add(new MyTest(false, testSuite.FullName, 0, testSuite.IsSuite, testSuite.GetType(),
                                          "", testSuite.TestCaseCount, false, null));
            }
            else
            {
                newMyTests.Add(new MyTest(false, testSuite.FullName, 0, testSuite.IsSuite, testSuite.GetType(),
                                          testSuite.Parent.FullName, testSuite.TestCaseCount, false, null));
            }
        }
        else
        {
            newMyTests.Add(new MyTest(index.Selected, index.TestName, index.Status, index.IsSuite, testSuite.GetType(),
                                      index.ParentName, testSuite.TestCaseCount, index.FoldOut, index.TestResultMessage));
        }
        foreach (var test in testSuite.Tests)
        {
            addTestSuiteToMyTest(test, newMyTests);
        }
    }