Beispiel #1
0
        public void Invoke_ShouldNotThrowExceptionIfInvocationUpdated()
        {
            // Arrange
            MockMethod subject = new MockMethod("methodName");

            subject.UpdateInvocation();

            // Act
            Action actual = () => subject.Invoke();

            // Assert
            actual.Should().NotThrow();
        }
Beispiel #2
0
        public void InvokeTask_ShouldNotThrowExceptionIfInvocationUpdated()
        {
            // Arrange
            MockMethod subject = new MockMethod("methodName");

            subject.UpdateInvocation();

            // Act
            Func <Task> actual = async() => await subject.InvokeTask();

            // Assert
            actual.Should().NotThrow();
        }
Beispiel #3
0
        public void Invoke_ShouldHaveMultipleInvocations()
        {
            // Arrange
            MockMethod subject = new MockMethod("methodName");

            subject.UpdateInvocation(() => { }, () => throw new Exception("Second Invocation"));

            // Act
            Action actual  = () => subject.Invoke();
            Action thrower = () => subject.Invoke();

            // Assert
            actual.Should().NotThrow();
            thrower.Should().ThrowExactly <Exception>().WithMessage("Second Invocation");
        }
Beispiel #4
0
        public void InvokeTask_ShouldHaveMultipleInvocations()
        {
            // Arrange
            MockMethod subject = new MockMethod("methodName");

            subject.UpdateInvocation(() => { }, () => throw new Exception("Second Invocation"));

            // Act
            Func <Task> actual = async() => await subject.InvokeTask();

            Func <Task> thrower = async() => await subject.InvokeTask();

            // Assert
            actual.Should().NotThrow();
            thrower.Should().ThrowExactly <Exception>().WithMessage("Second Invocation");
        }
Beispiel #5
0
 public Builder Restart()
 {
     _restart.UpdateInvocation();
     return(this);
 }
Beispiel #6
0
 public Builder Increment()
 {
     _increment.UpdateInvocation();
     return(this);
 }
 public Builder Release()
 {
     _release.UpdateInvocation();
     return(this);
 }
Beispiel #8
0
 public Builder Hide()
 {
     _hide.UpdateInvocation();
     return(this);
 }
Beispiel #9
0
 public Builder ToTop()
 {
     _toTop.UpdateInvocation();
     return(this);
 }
 public Builder ResponseTaskVoid()
 {
     _responseTaskVoid.UpdateInvocation();
     return(this);
 }
 public Builder VoidVoid()
 {
     _voidVoid.UpdateInvocation();
     return(this);
 }
Beispiel #12
0
 public Builder NeedsMe()
 {
     _needsMe.UpdateInvocation();
     return(this);
 }
Beispiel #13
0
 public Builder Disable()
 {
     _disable.UpdateInvocation();
     return(this);
 }
Beispiel #14
0
 public Builder Enable()
 {
     _enable.UpdateInvocation();
     return(this);
 }
Beispiel #15
0
 public Builder Close()
 {
     _close.UpdateInvocation();
     return(this);
 }
Beispiel #16
0
 public Builder Show()
 {
     _show.UpdateInvocation();
     return(this);
 }
Beispiel #17
0
 public Builder Clear()
 {
     _clear.UpdateInvocation();
     return(this);
 }
 public Builder UpdateInvocation()
 {
     _updateInvocationItem.UpdateInvocation();
     return(this);
 }
 public Builder WaitSync()
 {
     _waitSync.UpdateInvocation();
     return(this);
 }