Task AfterTestsRunTask(Task task, CodeCoverageResultsReader coverageResultsReader) { if (task.Exception != null) throw task.Exception; ShowCodeCoverageResultsPadIfNoCriticalTestFailures(); DisplayCodeCoverageResults(coverageResultsReader); return task; }
void DisplayCodeCoverageResults(CodeCoverageResultsReader coverageResultsReader) { foreach (CodeCoverageResults result in GetResults(coverageResultsReader)) { DisplayCodeCoverageResults(result); } foreach (string missingFile in coverageResultsReader.GetMissingResultsFiles()) { DisplayNoCodeCoverageResultsGeneratedMessage(missingFile); } }
Task AfterTestsRunTask(Task task, CodeCoverageResultsReader coverageResultsReader) { if (task.Exception != null) { throw task.Exception; } ShowCodeCoverageResultsPadIfNoCriticalTestFailures(); DisplayCodeCoverageResults(coverageResultsReader); return(task); }
public override void Run() { ClearCodeCoverageResults(); var coverageResultsReader = new CodeCoverageResultsReader(); var options = new TestExecutionOptions { ModifyProcessStartInfoBeforeTestRun = (startInfo, tests) => { OpenCoverApplication app = CreateOpenCoverApplication(startInfo, tests); coverageResultsReader.AddResultsFile(app.CodeCoverageResultsFileName); return app.GetProcessStartInfo(); } }; ITestService testService = SD.GetRequiredService<ITestService>(); IEnumerable<ITest> allTests = GetTests(testService); testService.RunTestsAsync(allTests, options) .ContinueWith(t => AfterTestsRunTask(t, coverageResultsReader)) .FireAndForget(); }
public override void Run() { ClearCodeCoverageResults(); var coverageResultsReader = new CodeCoverageResultsReader(); var options = new TestExecutionOptions { ModifyProcessStartInfoBeforeTestRun = (startInfo, tests) => { OpenCoverApplication app = CreateOpenCoverApplication(startInfo, tests); coverageResultsReader.AddResultsFile(app.CodeCoverageResultsFileName); return(app.GetProcessStartInfo()); } }; ITestService testService = SD.GetRequiredService <ITestService>(); IEnumerable <ITest> allTests = GetTests(testService); testService.RunTestsAsync(allTests, options) .ContinueWith(t => AfterTestsRunTask(t, coverageResultsReader)) .FireAndForget(); }
IEnumerable<CodeCoverageResults> GetResults(CodeCoverageResultsReader coverageResultsReader) { return SD.MainThread.InvokeIfRequired(() => coverageResultsReader.GetResults().ToList()); }
IEnumerable <CodeCoverageResults> GetResults(CodeCoverageResultsReader coverageResultsReader) { return(SD.MainThread.InvokeIfRequired(() => coverageResultsReader.GetResults().ToList())); }