Recursive mocking with Rhino-Mocks

Posted by jaspernygaard on Stack Overflow See other posts from Stack Overflow or by jaspernygaard
Published on 2009-09-29T08:40:29Z Indexed on 2010/04/05 18:03 UTC
Read the original article Hit count: 432

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

© Stack Overflow or respective owner

Related posts about rhino-mocks

Related posts about properties