public void RunnerSelectionTest(TestPackage package, RunnerResult expectedResult)
        {
            var masterRunner = new MasterTestRunner(_services, package);
            var runner       = masterRunner.GetEngineRunner();

            Assert.That(GetRunnerResult(runner), Is.EqualTo(expectedResult));
        }
        public void RunnerSelectionTest(TestPackage package, RunnerResult expected)
        {
            var masterRunner = new MasterTestRunner(_services, package);
            var runner       = masterRunner.GetEngineRunner();
            var result       = GetRunnerResult(runner);

            Assert.That(result, Is.EqualTo(expected).Using(RunnerResultComparer.Instance));
        }
Exemple #3
0
 public static RunnerResult AggregatingTestRunner(RunnerResult subRunnerType, int numSubRunners)
 {
     return(new RunnerResult()
     {
         TestRunner = typeof(AggregatingTestRunner),
         SubRunners = GetSubRunners(subRunnerType, numSubRunners)
     });
 }
Exemple #4
0
        private static RunnerResult[] GetSubRunners(RunnerResult subRunner, int count)
        {
            var subRunners = new RunnerResult[count];

            for (int i = 0; i < count; i++)
            {
                subRunners[i] = subRunner;
            }

            return(subRunners);
        }
        private static RunnerResult GetRunnerResult(ITestEngineRunner runner)
        {
            var result = new RunnerResult {
                TestRunner = runner.GetType()
            };

            if (runner is AggregatingTestRunner aggRunner)
            {
                result.SubRunners = aggRunner.Runners.Select(GetRunnerResult).ToList();
            }

            return(result);
        }
        private static TestCaseData MakeTestCase(string files, RunnerResult result)
        {
            var paths = new List <string>();

            foreach (var file in files.Split(new[] { ' ' }))
            {
                paths.Add(FullPathTo(file));
            }

            return(new TestCaseData(
                       new TestPackage(paths), result)
                   .SetArgDisplayNames(files));
        }