/// <summary> /// Subscribes to another event object such that the events will be forwarded /// to the handlers registered on this dispatcher. /// </summary> /// <param name="events">The other events object.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="events"/> is null.</exception> public void SubscribeTo(ITestRunnerEvents events) { if (events == null) { throw new ArgumentNullException("events"); } events.LogEntrySubmitted += (sender, e) => NotifyLogEntrySubmitted(e); events.MessageReceived += (sender, e) => NotifyMessageReceived(e); events.InitializeFinished += (sender, e) => NotifyInitializeFinished(e); events.InitializeStarted += (sender, e) => NotifyInitializeStarted(e); events.DisposeFinished += (sender, e) => NotifyDisposeFinished(e); events.DisposeStarted += (sender, e) => NotifyDisposeStarted(e); events.ExploreFinished += (sender, e) => NotifyExploreFinished(e); events.ExploreStarted += (sender, e) => NotifyExploreStarted(e); events.RunFinished += (sender, e) => NotifyRunFinished(e); events.RunStarted += (sender, e) => NotifyRunStarted(e); events.TestDiscovered += (sender, e) => NotifyTestDiscovered(e); events.AnnotationDiscovered += (sender, e) => NotifyAnnotationDiscovered(e); events.TestStepFinished += (sender, e) => NotifyTestStepFinished(e); events.TestStepLifecyclePhaseChanged += (sender, e) => NotifyTestStepLifecyclePhaseChanged(e); events.TestStepLogAttach += (sender, e) => NotifyTestStepLogAttach(e); events.TestStepLogStreamBeginMarkerBlock += (sender, e) => NotifyTestStepLogStreamBeginMarkerBlock(e); events.TestStepLogStreamBeginSectionBlock += (sender, e) => NotifyTestStepLogStreamBeginSectionBlock(e); events.TestStepLogStreamEmbed += (sender, e) => NotifyTestStepLogStreamEmbed(e); events.TestStepLogStreamEndBlock += (sender, e) => NotifyTestStepLogStreamEndBlock(e); events.TestStepLogStreamWrite += (sender, e) => NotifyTestStepLogStreamWrite(e); events.TestStepMetadataAdded += (sender, e) => NotifyTestStepMetadataAdded(e); events.TestStepStarted += (sender, e) => NotifyTestStepStarted(e); }
protected virtual void Dispose(bool disposing) { if (_events != null) { _events.ClassStarting -= events_TestClassStarting; _events.ClassStarted -= events_TestClassStarted; _events.ClassFinished -= events_TestClassFinished; _events.SubjectClassBindingStarting -= events_TestSubjectClassBindingStarting; _events.SubjectClassBindingStarted -= events_TestSubjectClassBindingStarted; _events.SubjectClassBindingFinished -= events_TestSubjectClassBindingFinished; _events.AssemblyStarting -= events_TestAssemblyStarting; _events.AssemblyStarted -= events_TestAssemblyStarted; _events.AssemblyFinished -= events_TestAssemblyFinished; _events.NamespaceStarting -= events_TestNamespaceStarting; _events.NamespaceStarted -= events_TestNamespaceStarted; _events.NamespaceFinished -= events_TestNamespaceFinished; _events.CaseStarting -= events_TestCaseStarting; _events.CaseStarted -= events_TestCaseStarted; _events.CaseFinished -= events_TestCaseFinished; _events.RunnerFinished -= events_TestRunnerFinished; _events.RunnerStarted -= events_TestRunnerStarted; _events.RunnerStarting -= events_TestRunnerStarting; _events.Message -= events_Message; _events.UnitStarted -= events_TestUnitStarted; _events.UnitStarting -= events_TestUnitStarting; _events.UnitFinished -= events_TestUnitFinished; _events.TheoryStarted -= events_TestTheoryStarted; _events.TheoryStarting -= events_TestTheoryStarting; _events.TheoryFinished -= events_TestTheoryFinished; _events = null; } _serviceProvider = null; }
public void Initialize(ITestRunnerEvents events, IServiceProvider serviceProvider) { if (events == null) { throw new ArgumentNullException("events"); } _serviceProvider = serviceProvider; _events = events; events.ClassStarting += events_TestClassStarting; events.ClassStarted += events_TestClassStarted; events.ClassFinished += events_TestClassFinished; events.AssemblyStarting += events_TestAssemblyStarting; events.AssemblyStarted += events_TestAssemblyStarted; events.AssemblyFinished += events_TestAssemblyFinished; events.NamespaceStarting += events_TestNamespaceStarting; events.NamespaceStarted += events_TestNamespaceStarted; events.NamespaceFinished += events_TestNamespaceFinished; events.CaseStarting += events_TestCaseStarting; events.CaseStarted += events_TestCaseStarted; events.CaseFinished += events_TestCaseFinished; events.RunnerFinished += events_TestRunnerFinished; events.RunnerStarted += events_TestRunnerStarted; events.RunnerStarting += events_TestRunnerStarting; events.UnitStarted += events_TestUnitStarted; events.UnitStarting += events_TestUnitStarting; events.UnitFinished += events_TestUnitFinished; events.TheoryStarted += events_TestTheoryStarted; events.TheoryStarting += events_TestTheoryStarting; events.TheoryFinished += events_TestTheoryFinished; events.Message += events_Message; }
private void StubTestRunnerFactory() { var testRunnerFactory = MockRepository.GenerateStub<ITestRunnerFactory>(); testRunner = MockRepository.GenerateStub<ITestRunner>(); testRunnerEvents = MockRepository.GenerateStub<ITestRunnerEvents>(); testRunner.Stub(tr => tr.Events).Return(testRunnerEvents); testRunnerFactory.Stub(trf => trf.CreateTestRunner()).Return(testRunner); testController.SetTestRunnerFactory(testRunnerFactory); }
private void StubTestRunnerFactory() { var testRunnerFactory = MockRepository.GenerateStub <ITestRunnerFactory>(); testRunner = MockRepository.GenerateStub <ITestRunner>(); testRunnerEvents = MockRepository.GenerateStub <ITestRunnerEvents>(); testRunner.Stub(tr => tr.Events).Return(testRunnerEvents); testRunnerFactory.Stub(trf => trf.CreateTestRunner()).Return(testRunner); testController.SetTestRunnerFactory(testRunnerFactory); }
/// <inheritdoc /> public void Install(ITestRunnerEvents events, ILogger logger) { if (events == null) throw new ArgumentNullException("events"); if (logger == null) throw new ArgumentNullException("logger"); this.events = events; this.logger = logger; Initialize(); }
/// <inheritdoc /> public void Install(ITestRunnerEvents events, ILogger logger) { if (events == null) { throw new ArgumentNullException("events"); } if (logger == null) { throw new ArgumentNullException("logger"); } this.events = events; this.logger = logger; Initialize(); }
/// <summary> /// Subscribes to another event object such that the events will be forwarded /// to the handlers registered on this dispatcher. /// </summary> /// <param name="events">The other events object.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="events"/> is null.</exception> public void SubscribeTo(ITestRunnerEvents events) { if (events == null) throw new ArgumentNullException("events"); events.LogEntrySubmitted += (sender, e) => NotifyLogEntrySubmitted(e); events.MessageReceived += (sender, e) => NotifyMessageReceived(e); events.InitializeFinished += (sender, e) => NotifyInitializeFinished(e); events.InitializeStarted += (sender, e) => NotifyInitializeStarted(e); events.DisposeFinished += (sender, e) => NotifyDisposeFinished(e); events.DisposeStarted += (sender, e) => NotifyDisposeStarted(e); events.ExploreFinished += (sender, e) => NotifyExploreFinished(e); events.ExploreStarted += (sender, e) => NotifyExploreStarted(e); events.RunFinished += (sender, e) => NotifyRunFinished(e); events.RunStarted += (sender, e) => NotifyRunStarted(e); events.TestDiscovered += (sender, e) => NotifyTestDiscovered(e); events.AnnotationDiscovered += (sender, e) => NotifyAnnotationDiscovered(e); events.TestStepFinished += (sender, e) => NotifyTestStepFinished(e); events.TestStepLifecyclePhaseChanged += (sender, e) => NotifyTestStepLifecyclePhaseChanged(e); events.TestStepLogAttach += (sender, e) => NotifyTestStepLogAttach(e); events.TestStepLogStreamBeginMarkerBlock += (sender, e) => NotifyTestStepLogStreamBeginMarkerBlock(e); events.TestStepLogStreamBeginSectionBlock += (sender, e) => NotifyTestStepLogStreamBeginSectionBlock(e); events.TestStepLogStreamEmbed += (sender, e) => NotifyTestStepLogStreamEmbed(e); events.TestStepLogStreamEndBlock += (sender, e) => NotifyTestStepLogStreamEndBlock(e); events.TestStepLogStreamWrite += (sender, e) => NotifyTestStepLogStreamWrite(e); events.TestStepMetadataAdded += (sender, e) => NotifyTestStepMetadataAdded(e); events.TestStepStarted += (sender, e) => NotifyTestStepStarted(e); }