Recursive mocking with Rhino-Mocks
- by jaspernygaard
Hi
I'm trying to unittest several MVP implementations and can't quite figure out the best way to mock the view. I'll try to boil it down. The view IView consists e.g. of a property of type IControl.
interface IView
{
IControl Control1 { get; }
IControl Control2 { get; }
}
interface IControl
{
bool Enabled { get; set; }
object Value { get; set; }
}
My question is whether there's a simple way to setup the property behavior for Enabled and Value on the IControl interface members on the IView interface - like recursive mocking a guess. I would rather not setup expectations for all my properties on the view (quite a few on each view).
Thanks in advance