private void InvokeMethod(int count = 1) { for (int i = 0; i < count; i++) { _instance.TestFunction("test"); } }
public void Mock_Should_HaveCalledOnly_should_work_as_expected() { Action verifyAction = () => _mock.Should().HaveCalledOnly(x => x.TestMethod()); AssertException(verifyAction, "Expected invocation on the mock once, but was 0 times: x => x.TestMethod"); _instance.TestMethod(); AssertSuccess(verifyAction); _instance.TestMethod(); _instance.TestFunction("test"); _test = _instance.TestProperty; AssertException(verifyAction, "The following invocations on mock"); }