Could you show an example of a method you'd like to test?  Regardless
of the decorator pattern, I can see how you could create a mock for
IXXX and, assuming XXXProvider.get is virtual, you could mock that to
return whatever you wanted as well.  So I'm not sure what particular
issue you're running in to.  Even if you can't show the real code, a
sample would help.

Thanks.

---
Patrick Steele
http://weblogs.asp.net/psteele



On Sun, Apr 25, 2010 at 9:47 AM, [email protected]
<[email protected]> wrote:
> Hi,
> I was wondering if there's a way to create a "decorator" mock for an
> existing object. It seems to be related to partial mocks but I haven't
> found a way to do it.
>
> my scenario is as follows :
>
> public interface IXXX
> {
>     int methodA();
>     int methodB();
> }
>
> public XXXProvider
> {
>    IXXX get()
>    {
>        //some factory implementatiom
>    }
> }
>
> I want to mock IXXX in so for the MethodA it will return 4, and for
> all other method will return the result of using some provided IXXX.
>
> --
> 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.
>
>

-- 
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.

Reply via email to