Hey all,

I'm trying to AssertWasCalled a certain method of a mocked (not stubbed) 
class, but the properties in it get reset to null.

I have:
          Foo foo = MockRepository.GenerateMock<Foo>();

Foo_Accessor fooAccessor = Foo_Accessor.AttachShadow(foo) // It's a private 
property, so I set it with an Accessor 

fooAccessor.Property = MockRepository.GenerateMock<PropertyClass>();

          // Do stuff that makes a call in foo.Method()

// This stuff successfully runs foo.Method() with the foo.Property set as 
the proxy

foo.AssertWasCalled(x => x.Method(""), o => o.IgnoreArguments());


However, when it runs x.Method(""), it shows foo.Property as being null. 
 Can I force-inject this property in the call? Or is there a way to 
permanently set it beforehand?
I think the fact that I have to use an Accessor.AttachShadow makes it more 
complicated...

Thanks for the help!
--Adam

 




            

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rhinomocks/-/NT-qNurRTwsJ.
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.

Reply via email to