After you've run your unit test, just assert that there is a new doc in the database and that it has the right fields set.
var newDoc = session.Load<T>(docId) or
var docs = session.Query<T>.Where(....).ToList(); RavenDB in-memory mode is there so that you don't have to mock it out, you just do the following:
- Open a new in-memory embedded doc store (with no data)
- If needed insert any data your unit test needs to run
- RUN the unit test
- Look at the data in the in-memory store and see if it has been updated correctly
Update If you want a full sample, take a look at how the RacoonBlog code does it, this is the code running Ayende's blog. See these 2 files: