예제 #1
0
        public void Invoke_ShouldReturnSameValueWhenInvokedMultipleTimesAndSetupWithOneResponse()
        {
            // Arrange
            string expected = "result";
            MockMethodWithResponse <string> subject = new MockMethodWithResponse <string>("methodName");

            subject.UpdateInvocation(expected);

            // Act
            string actual1 = subject.Invoke();
            string actual2 = subject.Invoke();
            string actual3 = subject.Invoke();


            // Assert
            actual1.Should().Be(expected);
            actual2.Should().Be(expected);
            actual3.Should().Be(expected);
        }
예제 #2
0
        public void Invoke_ShouldThrowExceptionWithMethodNameIfInvocationNotUpdated()
        {
            // Arrange
            MockMethodWithResponse <string> subject = new MockMethodWithResponse <string>("methodName");

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

            // Assert
            actual.Should().ThrowExactly <TestException>().WithMessage("If you want to use methodName, configure via Builder.");
        }
예제 #3
0
        public void Invoke_ShouldReturnValuesInOrderPassedIntoUpdateInvocationWhenInvokedMultipleTimes()
        {
            // Arrange
            string expected1 = "result1";
            string expected2 = "result2";
            string expected3 = "result3";
            MockMethodWithResponse <string> subject = new MockMethodWithResponse <string>("methodName");

            subject.UpdateInvocation(expected1, expected2, expected3);

            // Act
            string actual1 = subject.Invoke();
            string actual2 = subject.Invoke();
            string actual3 = subject.Invoke();

            // Assert
            actual1.Should().Be(expected1);
            actual2.Should().Be(expected2);
            actual3.Should().Be(expected3);
        }
예제 #4
0
        public void Invoke_ShouldThrowExceptionWhenUpdateInvocationSetUpForThat()
        {
            // Arrange
            MockMethodWithResponse <string> subject = new MockMethodWithResponse <string>("methodName");


            subject.UpdateInvocation(() => throw new Exception("I throw this"));

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

            // Assert
            actual.Should().ThrowExactly <Exception>().WithMessage("I throw this");
        }
예제 #5
0
        public void Invoke_ShouldReturnValuePassedIntoUpdateInvocation()
        {
            // Arrange
            string expected = "result";
            MockMethodWithResponse <string> subject = new MockMethodWithResponse <string>("methodName");

            subject.UpdateInvocation(expected);

            // Act
            string actual = subject.Invoke();

            // Assert
            actual.Should().Be(expected);
        }
예제 #6
0
 public IEnabled LongBreakStartEnabled() => _longBreakStartEnabled.Invoke();
예제 #7
0
 public Number Value() => _value.Invoke();
예제 #8
0
 public TResponse Invoke() => _invoke.Invoke();
 public string ResponseType() => _responseType.Invoke();
예제 #10
0
 protected override int RawValue() => _rawValue.Invoke();
예제 #11
0
 public Bool Finished() => _finished.Invoke();
예제 #12
0
 public TimeInterval Remaining() => _remaining.Invoke();
예제 #13
0
 public IVisibility SessionStartVisibility() => _sessionStartVisibility.Invoke();
예제 #14
0
 public IEnabled ShortBreakStartEnabled() => _shortBreakStartEnabled.Invoke();
예제 #15
0
 public IEnabled SessionStartEnabled() => _sessionStartEnabled.Invoke();
예제 #16
0
 public IVisibility LongBreakStartVisibility() => _longBreakStartVisibility.Invoke();
예제 #17
0
 public IVisibility ShortBreakStartVisibility() => _shortBreakStartVisibility.Invoke();
예제 #18
0
 public IWriteText CountDownTextWriter() => _countDownTextWriter.Invoke();
예제 #19
0
 public IWriteColor CountDownForeColorWriter() => _countDownForeColorWriter.Invoke();
예제 #20
0
 public Bool Last() => _last.Invoke();
예제 #21
0
 public ICountdownState CountdownState() => _countdownState.Invoke();
예제 #22
0
파일: MockText.cs 프로젝트: Fyzxs/IMock
 protected override string RawValue() => _rawValue.Invoke();
 public T ResponseGeneric() => _responseGeneric.Invoke();