For me personally I don't want Rhino to magically insert items, part of mocking is having control over items to know what is being returned. There is some sense of losing that when you want "AutoStubbing" behavior. Further you'd have to somehow tell the framework how "deep" to go and what objects too return...I see what you're after, I just don't like the road it leads you down.
You've got a bit of Law of Demeter issues going on...Rhino is always good about telling me when I've broken that rule by causing me to have to set up lots of stubs.... Just my thoughts... On Thu, Feb 5, 2009 at 5:02 PM, gbrunton <[email protected]> wrote: > > Just wondering what your thoughts are on the following... > > ... some method in a class that I will be testing ... > public void Method() > { > ... other stuff going on here..... > this.someClass.PerformAction().UpdateModelWithResults(this.model); > } > > now in a test fixture somewhere... > [SetUp] > public void SetUp() > { > this.someClass = MockRepository.GenerateStub<SomeClass>(): > } > > [Test] > public void TestingOtherStuffGoingOn() > { > ... some arranging ... > > this.CreateSUT().Method(); > > ... some assertions ... > } > > > Now in my TestingOtherStuffGoingOn test I could care less about the > someClass.PerformAction() method call because this is being testing in > some other method. But I can't test the "other stuff going on here" > logic without stubbing out another object that contains the > UpdateModelWithResults() method. > > Is there anyway (or would it even make sense) for rhinomocks to > automatically create a stub of the class that contains the > UpdateModelWithResults() method instead of a null value for the > PerformAction() method? > > Thoughts? > > Thanks, Gary > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
