Rhino Mocks AssertWasCalled (multiple times) on property getter using AAA
I have a mocked object that is passed as a constructor argument to another object. How can I test that a mocked object's property has been called? This is code I am using currently: INewContactAttributes newContact = MockRepository.GenerateMock<INewContactAttributes>(); newContact.Stub(x => x.Forenames).Return("One Two Three"); someobject.ConsumeContact(newContact); newContact.AssertWasCalled(x => { var dummy = x.Forenames; }); This works except when within the "someobject" the getter on Forenames property is used multiple times. That's when I get "Rhino.Mocks.Exceptions