You can set restrictions on parameters and parameter properties. The following code sets a restriction on the MyProperty property in your connection object. The layout expects MyProperty to be 42. Note that null is passed as a parameter, as it is ignored.
Expect .Call(connection.Retrieve(null)) .IgnoreArguments() .Constraints(Property.Value("MyProperty", 42)) .Return(returnedData);
I write this from memory, so it may not be entirely correct.
UPDATE:
Rhino Mocks version 3.5 introduces a new extension method GetArgumentsForCallsMadeOn, which allows you to check the parameters passed to defrauded objects:
http://kashfarooq.wordpress.com/2009/01/10/rhino-mocks-and-getargumentsforcallsmadeon/
source share