public void AssertInvokedWith_ShouldAssertInOrderOfInvocation_WithInvoke() { // Arrange string expected1 = "expected1"; string expected2 = "expected2"; MockMethodWithParam <string> subject = new MockMethodWithParam <string>("methodName"); subject.UpdateInvocation(); subject.Invoke(expected1); subject.Invoke(expected2); // Act Action actual = () => subject.AssertInvokedWith(expected1); Action actual2 = () => subject.AssertInvokedWith(expected2); // Assert actual.Should().NotThrow(); actual2.Should().NotThrow(); }
public void AssertInvokedWith_ShouldThrowWhenNotInvoked() { // Arrange MockMethodWithParam <string> subject = new MockMethodWithParam <string>("methodName"); subject.UpdateInvocation(); // Act Action actual = () => subject.AssertInvokedWith("expected"); // Assert actual.Should().Throw <Exception>().WithMessage("methodName was expected but not invoked."); }
public void AssertInvokedWith_ShouldThrowWhenFalse_WithInvoke() { // Arrange MockMethodWithParam <string> subject = new MockMethodWithParam <string>("methodName"); subject.UpdateInvocation(); subject.Invoke("Not expected"); // Act Action actual = () => subject.AssertInvokedWith("expected"); // Assert actual.Should().Throw <Exception>().WithMessage("Expected methodName to be invoked with expected but was actually invoked with Not expected"); }
public void AssertInvokedWith_ShouldNotThrowWhenTrue_WithInvoke() { // Arrange MockMethodWithParam <string> subject = new MockMethodWithParam <string>("methodName"); subject.UpdateInvocation(); subject.Invoke("expected"); // Act Action actual = () => subject.AssertInvokedWith("expected"); // Assert actual.Should().NotThrow(); }
public void AssertWriteInvokedWith(Text item) => _write.AssertInvokedWith(item);
public void AssertActInvokedWith(IMainForm form, ICountdownTimer timer) => _act.AssertInvokedWith(new Tuple <IMainForm, ICountdownTimer>(form, timer));
public void AssertWriteInvokedWith(ArgbColor item) => _write.AssertInvokedWith(item);
public void AssertActInvokedWith(ICountdownTimer timer) => _act.AssertInvokedWith(timer);
public void AssertActInvokedWith(IMainForm mainForm, ICountdownTime countdownTime, TimerProgress more) => _act.AssertInvokedWith(new Tuple <IMainForm, ICountdownTime, TimerProgress>(mainForm, countdownTime, more));
public void AssertUpdateInvocationResponseInvokedWith(params TResponse[] expected) => _updateInvocationTResponse.AssertInvokedWith(expected);
public void AssertParamTypeGenericInvokedWith(string justOne, T oneT) => _paramTypeGeneric.AssertInvokedWith(new Tuple <string, T>(justOne, oneT));
public void AssertParamTupleInvokedWith(string justOne, int singleInt) => _paramTuple.AssertInvokedWith(new Tuple <string, int>(justOne, singleInt));
public void AssertParamTypeResponseTaskInvokedWith(double justOne) => _paramTypeResponseTask.AssertInvokedWith(justOne);
public void AssertParamGenericInvokedWith(T justOne) => _paramGeneric.AssertInvokedWith(justOne);
public void AssertParamTypeInvokedWith(double justOne) => _paramType.AssertInvokedWith(justOne);
public void AssertShowAlertInvokedWith(Text message) => _showAlert.AssertInvokedWith(message);
public void AssertAssertInvokedWithInvokedWith(TParam expected) => _assertInvokedWith.AssertInvokedWith(expected);
public void AssertInvokeInvokedWith(TimerProgress progress) => _invoke.AssertInvokedWith(progress);