LoadTests() public method

public LoadTests ( string assemblyPath ) : Task>
assemblyPath string
return Task>
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);
            }
        }