I suggest you ...

Add VerifyNoMoreIntractions and VerifyZeroInteractions

This will allow to write tests like the following, which AFAICT are not possible at the moment:

// Arrange:
var mock = new Mock<IFoo>();
// Automatically return defaults for everything, so no additional setup.

// Act:
...

// Assert:
mock.Verify(foo => foo.SomeMethod());
mock.Verify(foo => foo.AnotherMethod());
mock.VerifyNoMoreInteractions();

Of course, one could use strict mode and specify all the expectations in advance, but that somewhat breaks the AAA approach.

6 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    anonymous shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base