private void CaptureTestResults(IEnumerable <TestResult> results) { var testResults = results as TestResult[] ?? results.ToArray(); TestResults.AddRange(testResults); if (!_testFailed && testResults.Any(result => result.Outcome == TestOutcome.Failed)) { // at least one test has failed _testFailed = true; TestsFailed?.Invoke(this, EventArgs.Empty); } }
private void OnTestsFinished(TestReport testReport) { if (_isAborting) { _dispatcher.BeginInvoke(() => TestsAborted?.Invoke(this, EventArgs.Empty)); } else if (testReport != null) { _dispatcher.BeginInvoke(() => TestsFinished?.Invoke(this, new EventArgs <TestReport>(testReport))); } else { _dispatcher.BeginInvoke(() => TestsFailed?.Invoke(this, EventArgs.Empty)); } }
public static int OutputResults() { Console.WriteLine(TestsRun.ToString() + " tests Run"); Console.WriteLine(TestsFailed.ToString() + " tests Failed"); if (TestsFailed > 0) { Console.WriteLine("FAILED"); } else { Console.WriteLine("SUCCESS"); } var lResult = Console.ReadKey(); return(TestsFailed); }
public MultiplexedTestRunner(IUnityContainer container, IOptions options) : base(container) { _options = options; UpdateImplementation(); foreach (var implementation in _implementations.Values) { implementation.DebuggingStarted += (o, e) => DebuggingStarted?.Invoke(this, e); implementation.TestStarted += (o, e) => TestStarted?.Invoke(this, e); implementation.TestExecuted += (o, e) => TestExecuted?.Invoke(this, e); implementation.TestLogAdded += (o, e) => TestLogAdded?.Invoke(this, e); implementation.TestsAborted += (o, e) => TestsAborted?.Invoke(this, e); implementation.TestsFailed += (o, e) => TestsFailed?.Invoke(this, e); implementation.TestsFinished += (o, e) => TestsFinished?.Invoke(this, e); implementation.TestsStarted += (o, e) => TestsStarted?.Invoke(this, e); } options.PropertyChanged += OnOptionChanged; }
public void Handle(TestsFailed @event) { TestsFailed(this, System.EventArgs.Empty); }
public override string ToString() { return(string.Format("---{0} {1} {2} Passed, {3} Failed, {4} Skipped {5}", Status, Filename.PadRight(40), TestsPassed.ToString().PadLeft(3), TestsFailed.ToString().PadLeft(3), TestsSkipped.ToString().PadLeft(3), Result)); }