public May<TestsLoadContext> LoadTests(string assemblyPath) { _log.Info("MsTest loading tests..."); var cci = new CciModuleSource(assemblyPath); var visitor = new MsTestTestsVisitor(); 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; } }
public May <TestsLoadContext> LoadTests(string assemblyPath) { _log.Info("MsTest loading tests..."); var cci = new CciModuleSource(assemblyPath); var visitor = new MsTestTestsVisitor(); 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); } }