I think you have to use record replay for Repeat.Times to get evaluated, although I could be wrong.
On Feb 12, 2:27 am, andreister <[email protected]> wrote: > [Test] > public void Test() > { > var foo = MockRepository.GenerateMock<IFoo>(); > foo.Expect(x => x.Bar()).Repeat.Times(3); > > Boo.Run(foo); > > foo.VerifyAllExpectations(); > > } > > public class Boo > { > public static void Run(IFoo foo) > { > foo.Bar(); > //foo.Bar(); > //foo.Bar(); > } > > } > > public interface IFoo > { > void Bar(); > > } > > On Feb 12, 1:21 am, jsearles <[email protected]> wrote: > > > I am trying to assert the number of times a method is called and it's > > not acting as i'm expecting. I am using version 3.5. I am doing as > > follows: > > > mock.Expect(x => x.DoSomething()).Repeat.Times(2); > > > [perform actions] > > > mock.VerifyAllExpectations(); > > > The problem is that this always passes, whether i change the times to > > 1 or 3 times. I want to know that the method was called exactly 2 > > times. > > > Thanks, > > > Josh --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/RhinoMocks?hl=en -~----------~----~----~----~------~----~------~--~---
