public void VerifyAtLeastOneCallTo_action_should_work()
        {
            var exp = _mock.Expression(x => x.WithString("test"));

            AssertExceptionMessageContaining("at least once, but was never performed",
                                             () => _mock.VerifyAtLeastOneCallTo(exp));

            _test.WithString("test");
            AssertExceptionNotThrown.WhenExecuting(() => _mock.VerifyAtLeastOneCallTo(exp));

            _test.WithString("test");
            AssertExceptionNotThrown.WhenExecuting(() => _mock.VerifyAtLeastOneCallTo(exp));
        }
Exemplo n.º 2
0
 public void Any_String_should_work()
 {
     ForTest.Scenarios("string1", "string2")
     .TestEach(scenario =>
     {
         _mock.ResetCalls();
         _test.WithString(scenario);
         _mock.VerifyOneCallTo(x => x.WithString(Any.String));
     });
 }
Exemplo n.º 3
0
 public void Any_String_should_work()
 {
     ForTest.Scenarios("string1", "string2")
     .TestEach(scenario =>
     {
         _mock.Invocations.Clear();
         _test.WithString(scenario);
         _mock.Verify(x => x.WithString(Any.String), Times.Once);
     });
 }