Setting expectations on properties with Rhino Mocks

Tuesday, 08 January 2008

Posted by Sébastien Lachance with Comments (0)

For the getter, it's exactly as you would do with a method :

 

Expect.Call(mockedConnection.CompanyConnectionString).Return("testconnectionstring");

For the setter, only assign the value you want to the property of the mocked object :

 

mockedConnection.ConnectionString = "testconnectionstring";</PRE



 




blog comments powered by Disqus