In my unit tests I am setting up each test to have a totally empty IDocumentSession. I do it like this:
[SetUp] public void SetUp() { _store = new EmbeddableDocumentStore { RunInMemory = true }; _store.Initialize(); Session = _store.OpenSession(); }
But I think this might be the reason my tests are a little slow. I was wondering if there is a simple command to delete all documents from the database.
What I want is to know is: if I can do this, and if it would improve performance.
This is the recommended approach for unit testing with ravendb The not recommended for production basically runs in the in memory mode If you find this to be slow, try profiling and figuring out what exactly is slowing things down
Try to use RunInUnreliableYetFastModeThatIsNotSuitableForProduction = true
.
var _store = new EmbeddableDocumentStore() { Configuration = { RunInUnreliableYetFastModeThatIsNotSuitableForProduction = true, RunInMemory = true, } };
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With