Hmmm. Yes I was also thinking along the same lines as Alex. But I was thinking that you could use PartialMultiMocks. I think that the syntax is: IMyInterface myMock = MockRepository.GeneratePartialMultiMock<IMyInterface>( typeof (MyConcreteClass) )
I have in fact used this to mock Windows.Forms user controls and that was a mission of note to get that right because I prefer to use stubs. Anyway, I was able to add a partial multi mock of type IMyCustomControl into a control's control collection. Hope this leads you down the right path. I agree with Bill that when you need to use this, it is already a less than ideal TDD situation. On Jan 29, 7:14 pm, Alex McMahon <[email protected]> wrote: > I must admit I've only scanned this thread, but have you looked at > MultiMocks? That's RhinoMocks way of having a single mock that implements > multiple interfaces... I know yours isn't multiple interfaces, rather > interface and base class, so I'm not sure it would work, but might be worth > a try. If I recall AAA syntax supports it something like > MockRepository.GenerateMock<Interface1, Interface2>() > > 2010/1/29 TheMightyKumquat <[email protected]> > > > > > > > Hi, just wanted to say thanks for the replies. No, Bill, your input > > didn't sound preachy. You're correct that this code wasn't developed > > in a test-driven manner, and it would have been so much easier if it > > had been. The sample code is not the real code I'mm testing, but the > > scenario was accurate, and it is from an MVC pattern web app. I don't > > really nhave a way around the immediate problem apart from to try to > > rework the code- we'll see what flexibility I have to do that... > > > Thanks for taking the time to write such a well-considered response, > > Bill and Tim. > > > -- > > 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]<rhinomocks%[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.
