I was having problems with a second call on a mock in my test run, so I moved the double calls into the test method. I have this:
RefBundle mockIRefBundle = mocks.StrictMock<IRefBundle>();
Expect.Call(mockIRefBundle.MaxTrackItems).Return( 6 ).Repeat.Any();
int q = mockIRefBundle.MaxTrackItems;
int z = mockIRefBundle.MaxTrackItems;
It fails when I make the second call to set "z" with an exception that implies the method was already called:
Error message:
System.InvalidOperationException: Previous method
'IRefBundle.get_MaxTrackItems();
'requires a return value or an exception to throw..
and Stack
Rhino.Mocks.Impl.RecordMockState.AssertPreviousMethodIsClose()
Rhino.Mocks.Impl.RecordMockState.MethodCall(IInvocation invocation,
...
The second call doesn't seem to honor the Repeat.Any()
What am I missing?