How can I Mock Indexed Property with Rhino Mocks ?
I'm assuming you mean a property using this[]
var mockClass = MockRepository.GenerateMock<MockClass>();
mockClass.Expect( m => m["key"] ).Return( "value" ); // return a value
mockClass.Expect( m => m["key2"] = "value2" ); // set a value
... some test in here using something that depends on mockClass...
mockClass.VerifyAllExpectations();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With