This is just another syntax to do the same. The following equivalents:
MockRepository mocks = new MockRepository();
ILoanRepository loanRepo = mocks.StrictMock<ILoanRepository>();
SetupResult.For(loanRepo.GetLoanExtended("sdfsdf")).Return(list.AsEnumerable<Loan>());
mocks.ReplayAll();
and
MockRepository mocks = new MockRepository();
using (mocks.Record()) {
ILoanRepository loanRepo = mocks.StrictMock<ILoanRepository>();
SetupResult.For(loanRepo.GetLoanExtended("sdfsdf")).Return(list.AsEnumerable<Loan>());
}
using (mocks.Playback()) {
}
To make things even more complex, there is a new third syntax in which you do not have explicit recording and playback phases called Arrange, Act, Assert Syntax, see for example http://ayende.com/blog/archive/2008/ 05/16 / rhino-mocks - arrange-act-assert-syntax.aspx
source
share