Exemple #1
0
        public void YouCanClearReceivedCalls()
        {
            // Create a stub.
            ISampleClass stub = CreateStub();

            // Call some method.
            stub.MethodThatReturnsInteger("foo");

            // Check that method was called.
            stub.Received().MethodThatReturnsInteger("foo");

            stub.ClearReceivedCalls();

            // Check that method was not called.
            stub.DidNotReceiveWithAnyArgs().MethodThatReturnsInteger(Arg.Any <string>());
        }