public static TestSuite GroupByNamespace(TestSuite testSuite)
        {
            if (testSuite == null)
                return null;

            var result = new TestSuite(testSuite.Name + ".Application");

            foreach (var testGroup in testSuite.Tests.GroupBy(x => GetNamespace(x)))
            {
                var namespaceSuite = new TestNamespace(testGroup.Key);
                foreach (var test in testGroup)
                {
                    namespaceSuite.Tests.Add(test);
                }

                result.Tests.Add(namespaceSuite);
            }

            return result;
        }
Пример #2
0
        public static TestSuite GroupByNamespace(TestSuite testSuite)
        {
            if (testSuite == null)
            {
                return(null);
            }

            var result = new TestSuite(testSuite.Name + ".Application");

            foreach (var testGroup in testSuite.Tests.GroupBy(x => GetNamespace(x)))
            {
                var namespaceSuite = new TestNamespace(testGroup.Key);
                foreach (var test in testGroup)
                {
                    namespaceSuite.Tests.Add(test);
                }

                result.Tests.Add(namespaceSuite);
            }

            return(result);
        }