예제 #1
0
        public virtual May <TestsLoadContext> LoadTests(string assemblyPath)
        {
            try
            {
                var testRoot = _nUnitWrapper.LoadTests(assemblyPath.InList());

                int testCount = testRoot.Values.Count();

                if (testCount == 0)
                {
                    return(May.NoValue);
                }

                var classNodes = BuildTestTree(testRoot);

                var context = new TestsLoadContext(FrameworkName, classNodes.ToList());

                UnloadTests();

                return(context);
            }
            catch (Exception e)
            {
                _log.Error("Excception While loading tests: ", e);
                throw;
            }
        }
예제 #2
0
        public ITestsRunContext CreateRunContext(TestsLoadContext loadContext, string mutatedPath)
        {
            var selector = new TestsSelector(loadContext.Namespaces);

            return(_testsRunContextFactory.CreateWithParams(_nunitConsolePath, mutatedPath, selector));
        }