I think Time doesn't need to mock the SomeClass instance, but just verify that the call has been made. In this case, just you don't need the .Return part. Am I right?
On the other hand, the mocked IConnection will return null, and that could throw an exception in the DoSome method. The solution is simple -- break this method into more testable parts. ulu On Oct 30, 2:34 am, "Tim Barcz" <[EMAIL PROTECTED]> wrote: > Rhino can mock concrete classes (along with abstract classes and > interfaces) try mocking the class to see what happens. > > Tim > > On 10/29/08, Time <[EMAIL PROTECTED]> wrote: > > > > > > > Hi. > > I have one external library wich export to me implementation of it > > interface IConnection. And I want mock this IConnection. It was simple > > if not some thing: IConnection has method ExampleMethod() wich return > > class TestClass() without interface and ... without constructor. > > > MockRepository mocks = new MocksRepository(); > > var conn = mocks.StrictMock<IConnecton>(); > > Expect.Call(conn.ExampleMethod()).Return(??????????) // I can't create > > mock for TestClass. > > MyClass myCl = new MyClass(conn); > > mocks.ReplayAll(); > > myCl.DoSomething(); > > mocks.VerifyAll(); > > > thx. > > -- > Sent from my mobile device --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
