Inheritance: Microsoft.Cci.CodeVisitor
Exemplo n.º 1
0
        public May <TestsLoadContext> LoadTests(string assemblyPath)
        {
            _log.Info("XUnit loading tests...");
            var cci = new CciModuleSource(assemblyPath);

            var visitor   = new XUnitTestsVisitor();
            var traverser = new CodeTraverser
            {
                PreorderVisitor = visitor
            };

            traverser.Traverse(cci.Module.Module);

            var classes = visitor.Classes.Where(c => c.Children.Count != 0).ToList();

            if (classes.Count != 0)
            {
                _log.Info("Tests loaded (" + classes.Count + " classes).");
                return(new May <TestsLoadContext>(new TestsLoadContext(FrameWorkName, classes)));
            }
            else
            {
                _log.Info("No tests found.");
                return(May.NoValue);
            }
        }
Exemplo n.º 2
0
        public May<TestsLoadContext> LoadTests(string assemblyPath)
        {
            _log.Info("XUnit loading tests...");
            var cci = new CciModuleSource(assemblyPath);

            var visitor = new XUnitTestsVisitor();
            var traverser = new CodeTraverser
            {
                PreorderVisitor = visitor
            };

            traverser.Traverse(cci.Module.Module);

            var classes = visitor.Classes.Where(c => c.Children.Count != 0).ToList();
            if(classes.Count != 0)
            {
                _log.Info("Tests loaded ("+ classes.Count + " classes).");
                return new May<TestsLoadContext>(new TestsLoadContext(FrameWorkName, classes));
            }
            else
            {
                _log.Info("No tests found.");
                return May.NoValue;
            }
        }