Unit testing RavenDb queries
问题 Is there a sensible way to stub/mock the results of a call to IDocumentSession.Query() ? I have a command where I'd like to verify that methods are called on objects (that is the "unit" being tested is the command NOT the objects the command orchestrates). I can't save Mock objects (via RhinoMocks) into an embedded db instance, so at the moment and being forced to verify state on the objects being called, rather than just verifying that the correct methods have been called. Thanks, Matt 回答1: