Can you post a test case? On Thu, Jul 16, 2009 at 5:00 PM, Shane C <[email protected]> wrote:
> > If I have a non-virtual method on a class that I am stub I get the > following error when I try to stub a return in. > > System.InvalidOperationException: You are trying to set an expectation > on a property that was defined to use PropertyBehavior. > Instead of writing code such as this: mockObject.Stub(x => > x.SomeProperty).Return(42); > You can use the property directly to achieve the same result: > mockObject.SomeProperty = 42; > > This is the wrong message since it's not a property at all. The > problem was that the method wasn't virtual. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
