-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
Times.Never is incorrectly reported in a setup with Times.Exactly #211
Comments
I cannot reproduce this issue. This is my test:
The test results are as follows:
The "No setups configured" message appears as there were no setups. |
Has a new version been out since? This bug turns 7 months tomorrow... |
You bet :p On Tue, May 24, 2016, 10:19 PM Kirill Katsnelson notifications@github.com
|
@kkm000, it's been a while, but if you are still willing to help diagnose this error, could you please provide a small but complete program or unit test that reproduces the problem? |
@stakx: Let me try tomorrow, thanks! It's been a while, so the bug might have fixed itself since then. I'll test. |
This could be fixed (the bug sits in
|
Here's a repro for this (or at least for a very similar) issue: var mock = new Mock<IX>(MockBehavior.Never);
mock.Setup(x => x.Create(It.IsAny<CspParameters>()));
mock.Object.Create(null);
mock.Object.Create(null);
mock.Verify(x => x.Create(It.IsAny<CspParameters>()), Times.Exactly(11));
public interface IX
{
void Create(CspParameters parameters);
}
public class CspParameters { } Which produces the following exception message:
Note how it misreports the number of actual invocations as the number of expected invocations in the section "Configured setups", Fact is that no |
This should be fixed with the next release of Moq (version >4.7.63). |
The following calll to
Verify
results in this message:
Note misreported
Times.Never
. Expected in the message eitherTimes.Exactly(11)
, or a message to the effect of absence of any configured setups, because there were truly none. The number is reported correctly in the preceding text however.The text was updated successfully, but these errors were encountered: