RhinoMocks: AssertWasCalled doesn't work on Stub
问题 I'm trying to assert with RhinoMocks that a certain property setter was called. But it's not working as expected. The following simplified example illustrates the problem. Consider this interface: public interface IMyInterface { string SomeProperty { get; set; } } And now consider the following code: var mock = MockRepository.GenerateStub<IMyInterface>(); mock.SomeProperty = "abc"; mock.AssertWasCalled(x => x.SomeProperty = Arg<string>.Is.Anything); I was expecting the assert on the last line