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

            subject.UpdateInvocation();

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

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