I was having problems with the second layout call in my test run, so I moved the double calls to the test method. I have it:
RefBundle mockIRefBundle = mocks.StrictMock<IRefBundle>();
Expect.Call(mockIRefBundle.MaxTrackItems).Return( 6 ).Repeat.Any();
int q = mockIRefBundle.MaxTrackItems;
int z = mockIRefBundle.MaxTrackItems;
This fails when I make a second call to set "z" with an exception, which implies that the method has already been 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 does not seem to justify Repeat.Any ()
What am I missing?
source
share