public void Any_DateTime_should_work() { ForTest.Scenarios(DateTime.Now, DateTime.Now.AddMonths(1)) .TestEach(scenario => { _mock.Invocations.Clear(); _test.WithDateTime(scenario); _mock.Verify(x => x.WithDateTime(Any.DateTime), Times.Once); }); }
public void Any_DateTime_should_work() { ForTest.Scenarios(DateTime.Now, DateTime.Now.AddMonths(1)) .TestEach(scenario => { _mock.ResetCalls(); _test.WithDateTime(scenario); _mock.VerifyOneCallTo(x => x.WithDateTime(Any.DateTime)); }); }
public void VerifyNoCallsTo_action_should_work() { var exp = _mock.Expression(x => x.WithDateTime(Any.DateTime)); AssertExceptionNotThrown.WhenExecuting(() => _mock.VerifyNoCallsTo(exp)); _test.WithDateTime(DateTime.Now); AssertExceptionMessageContaining("should never have been performed, but was 1 times", () => _mock.VerifyNoCallsTo(exp)); }