Esempio n. 1
0
        public void Invoke_ShouldNotThrowExceptionIfInvocationUpdated()
        {
            // Arrange
            MockMethod subject = new MockMethod("methodName");

            subject.UpdateInvocation();

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

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