-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add info to AmbiguousArgumentsException #262
Comments
I hit this problem because other tests in the class were substituting an extension method (part of a refactor). This error went away once I fixed up the substitutions. Perhaps there needs to be some validation on the substitution request to validate that the member can be stubbed out. Should a separate issue be raised for this? Another potential change (related to this issue) is to indicate in the exception message that other incorrect substitutions in the test run may be causing this issue. |
Hi @roryprimrose, If I've misunderstood or if you have some ideas on how we can detect these cases please let me know. :) |
Thanks @dtchepak I tried to simulate this scenario but the error I got actually gave a good error message.
I don't understand why this code produces the nice failure from NSub but my more complex scenario didn't. Perhaps it was that there was a suite of tests being executed and that incorrect tests caused the others to fail. Either way, the linked issue helped me to figure out that I needed to fix the tests broken by my refactor to remove the problem. At this stage I would say just ignore my previous comment :) Thanks for the quick response. |
Closing as part of a general cleanup of blocked issues. Please re-open if more information comes to light which will let us proceed with this. |
From 260, would be useful to put info on what call is being run in
AmbiguousArgumentsException
, and also the arg matchers available vs. provided arguments (to narrow down what is ambiguous).The text was updated successfully, but these errors were encountered: