Testing RavenDb Modules

Is there any reasonable way to mute / mock the results of calling IDocumentSession.Query() ?

I have a command where I would like to verify that the methods are called on objects (that is, the test "unit" is the NOT command, which the objects group). I can’t save Mock objects (via RhinoMocks) into a built-in db instance, therefore at the moment I am forced to check the state on the called objects, and not just check that the correct methods were called.

Thanks Matt

+6
source share
1 answer

You'd better use EmbeddableDocumentStore { RunInMemory = true} for unit testing. However, IDocumentSession should be very easy to taunt.

+6
source

Source: https://habr.com/ru/post/903002/


All Articles