private TestResult run(TestRunner testRunner, TestHarvester harvester, TestFilter testFilter, string savedDirectory)
 {
     TestResult result = null;
     try
     {
         result = testRunner.Run(harvester, testFilter, false, LoggingThreshold.Off);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
     finally
     {
         Environment.CurrentDirectory = savedDirectory;
     }
     return result;
 }
        private IEnumerable<Shared.Results.TestResult> runTests(Options options, TestPackage package, TestRunner testRunner)
        {
            testRunner.Load(package);
            if (testRunner.Test == null)
            {
                testRunner.Unload();
                return new[] { ErrorHandler.GetError("NUnit", "Unable to locate fixture") };
            }

            var harvester = new TestHarvester(_channel);
            var testFilter = getTestFilter(options);
            string savedDirectory = Environment.CurrentDirectory;
            var result = run(testRunner, harvester, testFilter, savedDirectory);

            if (result != null)
                return harvester.Results;
            return harvester.Results;
        }
Exemple #3
0
        private TestResult run(TestRunner testRunner, TestHarvester harvester, TestFilter testFilter, string savedDirectory)
        {
            TestResult result = null;

            try
            {
                result = testRunner.Run(harvester, testFilter);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            finally
            {
                Environment.CurrentDirectory = savedDirectory;
            }
            return(result);
        }
        private IEnumerable <Shared.Results.TestResult> runTests(Options options, TestPackage package, TestRunner testRunner)
        {
            testRunner.Load(package);
            if (testRunner.Test == null)
            {
                testRunner.Unload();
                return(new[] { ErrorHandler.GetError("NUnit", "Unable to locate fixture") });
            }

            var    harvester      = new TestHarvester(_channel);
            var    testFilter     = getTestFilter(options);
            string savedDirectory = Environment.CurrentDirectory;
            var    result         = run(testRunner, harvester, testFilter, savedDirectory);

            if (result != null)
            {
                return(harvester.Results);
            }
            return(harvester.Results);
        }