15

What is Rhino Mocks Repeat ?

Repeat.Any();

Repeat.Once();

What does it mean and how it works ?

Marijn
  • 10,367
  • 5
  • 59
  • 80
Yoann. B
  • 11,075
  • 19
  • 69
  • 111

1 Answers1

25

It is used with the Expect construct as part of a fluent declaration. As for what it means: it means that the previous event is expected to occur that many times.

For instance: Expect.Call(someMethod()).Repeat.Twice() says that someMethod() will be called exactly two times.

Konstantin Purtov
  • 799
  • 1
  • 11
  • 19
Matthew Brubaker
  • 3,097
  • 1
  • 21
  • 18
  • 3
    I think [this](http://stackoverflow.com/questions/887245/rhino-mocks-repeat-once-not-working) post explains it very well, at least from my own experience where I found the fluent API a bit confusing. – lbergnehr Dec 06 '11 at 07:49