我想创建以下接口的存根:
interface IUnitOfWork
{
void DoInTransaction(Action method);
}
在存根对象中,我DoInTransaction
要做的就是运行method()
。
就像是:
// pseudo-code
unitOfWorkStub.Stub(x => x.DoInTransaction(method)).Do(method())
是否可以使用 RhinoMocks 创建这种存根?如何才能做到这一点?