I suggest you ...

Make callbacks more flexible about the required parameters

Sometimes you don't need all the parameters of the mocked method in the callback. Sometimes you don't need any of them.

Is it possible to allow partial matches, I'm thinking if there are 4 parameters on the method, and only 3 on the callback, if the first 3 match then allow that callback.

As the callback verification seems to be done at run time I think this should be possible.

8 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…)
    azdlowry shared this idea  ·   ·  Admin →
    under review  ·  Adminkzu (Admin, moq) responded  · 

    what should be the batching behavior? Argument type obviously, but what about ordering? What if the method has 2 string parameters mixed with other types?

    1 comment

    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...
      • azdlowry commented  · 

        I think as a first step, just matching the parameters by position would be enough, anything more complicated may be confusing.

      Feedback and Knowledge Base