Hi! I started using Rhino.Mocks a few weeks ago and I am pretty happy with it, it's a great time saver!
However, I have come across the need to change the return value of a method stub. There is a solution "out there" that involves calling BackToRecord (...All) on the mock object. The problem with this is, that it also seems to reset all events of the mocked object, losing all of its subscribers... That's actually pretty bad. The only way around this is to not use BackToRecord, instead, I store the IMethodOptions object returned by the call to Stub and call Return on it. Every call to Return effectivly overrides the old return value. The drawback is that I have to need this IMethodOptions object in the first place. It would be nice if two calls to Stub with the same parameters would return the same IMethodOptions instance. What do you think? Am I overseeing something? Kind regards, Daniel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
