Ejemplo n.º 1
0
 public void OnCompleted_ShouldCallOnCompleted(
     ScreenshotInfoToActionAttachmentObserverAdapter sut)
 {
     // act
     sut.OnCompleted();
     // assert
     Mock.Get(sut.AttachmentObserver).Verify(o => o.OnCompleted());
 }
Ejemplo n.º 2
0
 public void OnError_ShouldCallOnError(
     ScreenshotInfoToActionAttachmentObserverAdapter sut, Exception exception)
 {
     // act
     sut.OnError(exception);
     // assert
     Mock.Get(sut.AttachmentObserver).Verify(o => o.OnError(exception));
 }
Ejemplo n.º 3
0
        public void OnNext_ShouldCallOnNext(
            ScreenshotInfoToActionAttachmentObserverAdapter sut,
            string filename)
        {
            // arrange
            var screenshotInfo = new ScreenshotInfo(Fixture.WebDriver.GetScreenshot(), filename);

            // act
            sut.OnNext(screenshotInfo);
            // assert
            var expected = new ActionFileAttachment(filename, string.Empty);

            Mock.Get(sut.AttachmentObserver).Verify(o => o.OnNext(It.Is <ActionFileAttachment>(a =>
                                                                                               a.FilePath == filename + ".jpg" &&
                                                                                               a.Description == string.Empty)));
        }
Ejemplo n.º 4
0
 public void Sut_ShouldBeObserverOfScreenshotInfo(ScreenshotInfoToActionAttachmentObserverAdapter sut)
 {
     sut.Should().BeAssignableTo <IObserver <ScreenshotInfo> >();
 }