_presenter.InsertRule();
_mocks.VerifyAll();
With the above code, if AddErrorMessage isn't called at all, the test
fails as expected, but as long as it is called at least once, the test
passes. Am I missing something? I'm expecting that Repeat.Once means
"once and only once".
I'm using Rhino.Mocks version 3.2.0.781
Thanks,
Matt
[Test]
public void TestRepeatOnce()
{
MockRepository mockery = new MockRepository();
IInsertRuleView mockView =
mockery.DynamicMock<IInsertRuleView>();
Expect.Call(mockView.AddErrorMessage("test")).Return(true).Repeat.Once();
mockery.ReplayAll();
mockView.AddErrorMessage("test");
mockView.AddErrorMessage("test");
mockery.VerifyAll();
}
On Sep 24, 10:38 am, EmmanuelGoldstein <matt.horn...@gmail.com> wrote:
> > Matt- Hide quoted text -
>
> - Show quoted text -
On Sep 24, 10:38 am, EmmanuelGoldstein <matt.horn...@gmail.com> wrote:
On Sep 28, 10:33 am, "Ayende Rahien" <aye...@ayende.com> wrote:
> This is the expected behavior.
> Dynamic Mock will ignore any unknown calls that your make to it.
> Therefor, setting up any Repeat means that you are setting a minimum, not a
> hard limit.
>
Derick: I'm glad my hours of freaking out saved you some time ;)