コード例 #1
0
        public async Task <TestRunResult> ExecuteTests(IEnumerable <ITest> tests = null, bool force = false)
        {
            var resultPackage = new TestRunResult();

            var filter   = new CustomTestFilter(tests, force);
            var listener = Options?.LogToOutput == true ? new CustomTestListener() : TestListener.NULL;
            var result   = await Task.Run(() => _runner.Run(listener, filter)).ConfigureAwait(false);

            LogTestRun(result);

            resultPackage.AddResult(result);
            resultPackage.CompleteTestRun();
            return(resultPackage);
        }
コード例 #2
0
ファイル: TestPackage.cs プロジェクト: devbfs/nunit.xamarin
        public async Task <TestRunResult> ExecuteTests()
        {
            var resultPackage = new TestRunResult();

            foreach (var assembly in _testAssemblies)
            {
                NUnitTestAssemblyRunner runner = await LoadTestAssemblyAsync(assembly).ConfigureAwait(false);

                ITestResult result = await Task.Run(() => runner.Run(TestListener.NULL, TestFilter.Empty)).ConfigureAwait(false);

                resultPackage.AddResult(result);
            }
            resultPackage.CompleteTestRun();
            return(resultPackage);
        }