Exemple #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);
        }
Exemple #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.");
        }
Exemple #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);
        }
Exemple #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");
        }
Exemple #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);
        }
Exemple #6
0
 public IEnabled LongBreakStartEnabled() => _longBreakStartEnabled.Invoke();
Exemple #7
0
 public Number Value() => _value.Invoke();
Exemple #8
0
 public TResponse Invoke() => _invoke.Invoke();
 public string ResponseType() => _responseType.Invoke();
Exemple #10
0
 protected override int RawValue() => _rawValue.Invoke();
 public Bool Finished() => _finished.Invoke();
Exemple #12
0
 public TimeInterval Remaining() => _remaining.Invoke();
Exemple #13
0
 public IVisibility SessionStartVisibility() => _sessionStartVisibility.Invoke();
Exemple #14
0
 public IEnabled ShortBreakStartEnabled() => _shortBreakStartEnabled.Invoke();
Exemple #15
0
 public IEnabled SessionStartEnabled() => _sessionStartEnabled.Invoke();
Exemple #16
0
 public IVisibility LongBreakStartVisibility() => _longBreakStartVisibility.Invoke();
Exemple #17
0
 public IVisibility ShortBreakStartVisibility() => _shortBreakStartVisibility.Invoke();
Exemple #18
0
 public IWriteText CountDownTextWriter() => _countDownTextWriter.Invoke();
Exemple #19
0
 public IWriteColor CountDownForeColorWriter() => _countDownForeColorWriter.Invoke();
 public Bool Last() => _last.Invoke();
 public ICountdownState CountdownState() => _countdownState.Invoke();
Exemple #22
0
 protected override string RawValue() => _rawValue.Invoke();
 public T ResponseGeneric() => _responseGeneric.Invoke();