Пример #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
 protected override string RawValue() => _rawValue.Invoke();
 public T ResponseGeneric() => _responseGeneric.Invoke();