How can I Mock Indexed Property with Rhino Mocks ?
+5
A:
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();
tvanfosson
2009-01-09 22:18:18
Ok Thanks a lot ! :)
Yoann. B
2009-01-09 22:23:22