Ejemplo n.º 1
0
        private async Task <May <TestNodeAssembly> > LoadFor(string path1, TestNodeAssembly testNodeAssembly)
        {
            var contexts = await _testServiceManager.LoadTests(path1);

            if (contexts.Count == 0)
            {
                return(May.NoValue);
            }
            else
            {
                testNodeAssembly.TestsLoadContexts = contexts;

                var allClassNodes = contexts.SelectMany(context => context.ClassNodes);
                IEnumerable <TestNodeNamespace> testNamespaces =
                    TestsLoadContext.GroupTestClasses(allClassNodes.ToList(), testNodeAssembly);

                testNodeAssembly.Children.AddRange(testNamespaces);
                return(new May <TestNodeAssembly>(testNodeAssembly));
            }

            //                        else return result.Result.Bind(context =>
            //                        {
            //                          //
            //
            //                            IEnumerable<TestNodeNamespace> testNamespaces =
            //                                GroupTestClasses(context.ClassNodes, testNodeAssembly);
            //
            //                            testNodeAssembly.Children.AddRange(testNamespaces);
            //                            return new May<TestNodeAssembly>(testNodeAssembly);
            //                        });
        }
Ejemplo n.º 2
0
        private async Task LoadFor(IEnumerable <string> path1, TestsRootNode testsRootNode)
        {
            var contexts = await _testServiceManager.LoadTests(path1);

            foreach (var testContext in contexts.OrderBy(p => p.AssemblyName))
            {
                var testNodeAssembly = new TestNodeAssembly(testsRootNode, testContext.AssemblyName);

                testNodeAssembly.TestsLoadContexts = new List <TestsLoadContext> {
                    testContext
                };

                var allClassNodes = testContext.ClassNodes;

                IEnumerable <TestNodeNamespace> testNamespaces = TestsLoadContext.GroupTestClasses(allClassNodes.ToList(), testNodeAssembly);

                testNodeAssembly.Children.AddRange(testNamespaces);

                testsRootNode.Children.Add(testNodeAssembly);
            }
        }
Ejemplo n.º 3
0
 public ITestsRunContext CreateRunContext(TestsLoadContext loadContext, string mutatedPath)
 {
     var tesele = new TestsSelector(loadContext.Namespaces);
     return _contextFactory.CreateWithParams(MsTestConsolePath, mutatedPath, tesele);
 }
Ejemplo n.º 4
0
        public ITestsRunContext CreateRunContext(TestsLoadContext loadContext, string mutatedPath)
        {
            var tesele = new TestsSelector(loadContext.Namespaces);

            return(_contextFactory.CreateWithParams(XUnitConsolePath, mutatedPath, tesele));
        }
Ejemplo n.º 5
0
 public ITestsRunContext CreateRunContext(TestsLoadContext loadContext, string mutatedPath)
 {
     return(_services[loadContext.FrameworkName].CreateRunContext(loadContext, mutatedPath));
 }
Ejemplo n.º 6
0
 public ITestsRunContext CreateRunContext(TestsLoadContext loadContext, string mutatedPath)
 {
    
     return _services[loadContext.FrameworkName].CreateRunContext(loadContext, mutatedPath);
 }