When I use something like:

mock.Expect(x => x.Xxx()).Repeat.Times(4);

I am expecting x.Xxx() to be invoked exactly 4 times. I find my test
fails (as expected) provided the actual number of times it's invoked
<= 4.

My test passes (not expected) when actual number of times > 4.

This seems to be due to AbstractExpectation not accepting call once
the maximum has been reached (4 in this case).

If I modify the following property as follows, I get the expected
behaviour:

// AbstractExpectation
public bool CanAcceptCalls
        {
            get
            {
                //I don't bother to check for RepeatableOption.Never
because
                //this is handled the method recorder
                if (repeatableOption == RepeatableOption.Any)
                    return true;

                // BJB, 2009-06-22
                return true;
                // return expected.Max == null || actualCallsCount <
expected.Max.Value;
            }
        }

Any tips?

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to