Does below helps a bit to reuse?
[Test] public void Test()
{
var i = MockRepository.GenerateStub<IFoo>();
SetUpIFoo<DomainObject1>(i);
SetUpIFoo<DomainObject2>(i);
SetUpIFoo<AnotherDomainObject>(i);
}
private void SetUpIFoo<T>(IFoo foo) where T : class, IDomainObject
{
foo.Stub(x =>
x.CreateDomainObject<T>()).Return(MockRepository.GenerateStub<T>());
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rhinomocks?hl=en
-~----------~----~----~----~------~----~------~--~---