public void Consume(object o) { lock (_feedbackLock) { _syncCtx.Post((message) => { if (message.GetType().Equals(typeof(AutoTest.Messages.BuildRunMessage))) { if (BuildFinished == null) { return; } var msg = (AutoTest.Messages.BuildRunMessage)message; BuildFinished(this, BuildFinishedArgs.FromInternal(msg)); } else if (message.GetType().Equals(typeof(AutoTest.Messages.TestRunMessage))) { if (TestsFinished == null) { return; } var msg = (AutoTest.Messages.TestRunMessage)message; TestsFinished(this, TestsFinishedArgs.FromInternal(msg)); } else if (message.GetType().Equals(typeof(AutoTest.Messages.LiveTestStatusMessage))) { if (TestProgress == null) { return; } var msg = (AutoTest.Messages.LiveTestStatusMessage)message; TestProgress(this, ImmediateTestFeedbackArgs.FromInternal(msg)); } }, o); } }
static void engine_TestProgress(object sender, ImmediateTestFeedbackArgs e) { System.Console.WriteLine("Completed {0} tests, current assembly {1}", e.TestsCompleted, e.CurrentAssembly); }