コード例 #1
0
 public void OnError_ShouldCallOnError(RenderedReportingObserver sut, Exception exception)
 {
     // act
     sut.OnError(exception);
     // assert
     Mock.Get(sut.Observer).Verify(o => o.OnError(exception));
 }
コード例 #2
0
 public void OnCompleted_ShouldCallOnCompleted(RenderedReportingObserver sut)
 {
     // act
     sut.OnCompleted();
     // assert
     Mock.Get(sut.Observer).Verify(o => o.OnCompleted());
 }
コード例 #3
0
 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)})";
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 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}";
 }