Hi
You can do that like this in reflective mocks:
mock.ExpectAndThrow("MyMethod", new MyException(), 2);
The last parameter to ExpectAndThrow method is number of times to throw the exception.
And using natural mocks:
using (RecordExpectations recorder = RecorderManager.StartRecording())
{
MyClass mock = new MyClass();
recorder.ExpectAndThrow(mock.MyMethod(), new MyException()).Repeat(2);
}
Here you the Repeat method handles the number of time to throw the exception.