The extension method ReceivedCalls()
, which returns all calls that were received by the substitute, can be used to test that no calls were received.
For example (using FluentAssertions):
mySubstitute.ReceivedCalls().Should().BeEmpty();
Or using MSTest assertions:
Assert.IsFalse(mySubstitute.ReceivedCalls().Any());
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…