Help, can anyone help out and explain the purpose of the Rhino Mocks 'Record' scope?
I assumed that that the expectation set within the scope would only be verified but it seems as soon as you create the mock object, Rhino Mocks is in 'record mode' so I'm now unsure of the purpose of the Record scope.
Here's an example I have:
private static void SomeTest()
{
MockRepository mockRepository = new MockRepository();
ISomeInterface test = mockRepository.StrictMock<ISomeInterface>();
test.Bar();
using (mockRepository.Record())
{
Expect.Call<string>(test.GetFoo()).Return("Hello");
}
using (mockRepository.Playback())
{
test.GetFoo();
}
}
public interface ISomeInterface
{
string GetFoo();
void Bar();
}
This test would fail because there is an expectation that Bar should be called. Is it because I've created a StrictMock and not Dynamic?