private AfterTestFinishedEventArgs NotifyFinished() { var args = new AfterTestFinishedEventArgs(_service, _configuration); Notify(() => ReportEventsSource.RaiseAfterTestFinished(_reportEventsSource, this, args)); return(args); }
public void ShouldNotifyAfterItemFinished() { ILaunchReporter l = null; ITestReporter t = null; AfterLaunchFinishedEventArgs afterLaunchFinishedEventArgs = null; AfterTestFinishedEventArgs afterTestFinishedEventArgs = null; var observer = new Mock <IReportEventsObserver>(); observer.Setup(o => o.Initialize(It.IsAny <IReportEventsSource>())).Callback <IReportEventsSource>(s => { s.OnAfterLaunchFinished += (a, b) => { l = a; afterLaunchFinishedEventArgs = b; }; s.OnAfterTestFinished += (a, b) => { t = a; afterTestFinishedEventArgs = b; }; }); var extManager = new Shared.Extensibility.ExtensionManager(); extManager.ReportEventObservers.Add(observer.Object); var client = new MockServiceBuilder().Build().Object; var launch = new LaunchReporterBuilder(client).With(extManager).Build(1, 0, 0); launch.Sync(); afterLaunchFinishedEventArgs.ClientService.Should().BeSameAs(client); l.Should().BeSameAs(launch); afterTestFinishedEventArgs.ClientService.Should().BeSameAs(client); t.Should().BeSameAs(launch.ChildTestReporters[0]); }
public static void RaiseAfterTestFinished(ReportEventsSource source, ITestReporter testReporter, AfterTestFinishedEventArgs args) { source.OnAfterTestFinished?.Invoke(testReporter, args); }