public void OnError_ShouldCallOnError(RenderedReportingObserver sut, Exception exception) { // act sut.OnError(exception); // assert Mock.Get(sut.Observer).Verify(o => o.OnError(exception)); }
public void OnCompleted_ShouldCallOnCompleted(RenderedReportingObserver sut) { // act sut.OnCompleted(); // assert Mock.Get(sut.Observer).Verify(o => o.OnCompleted()); }
public void DefaultRenderer_WithAfterNotification_ShouldReturnCorrectValue( int depth, string prefix, AfterActionNotificationContent notificationContent, INamed named) { // arrange // act var actual = RenderedReportingObserver.DefaultRenderer(new ActionNotification(named, depth, notificationContent)); // assert var expected = prefix + $"Ending {named.Name} ({notificationContent.Duration.ToString("g", CultureInfo.CurrentCulture)})"; }
public void DefaultRenderer_WithBeforeNotification_ShouldReturnCorrectValue( int depth, string prefix, BeforeActionNotificationContent notificationContent, INamed named) { // arrange // act var actual = RenderedReportingObserver.DefaultRenderer(new ActionNotification(named, depth, notificationContent)); // assert var expected = prefix + " Starting " + named.Name; }
public void DefaultRenderer_WithErrorNotification_ShouldReturnCorrectValue( int depth, string prefix, ExecutionErrorNotificationContent notificationContent, INamed named) { // arrange // act var actual = RenderedReportingObserver.DefaultRenderer(new ActionNotification(named, depth, notificationContent)); // assert var expected = prefix + $"Error in {named.Name}\n({notificationContent.Exception.Message}"; }