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