Reputation: 21599
I have integration tests using RavenDB with RunInMemory = true
. One of the issues I am debugging is related to JSON serialization. What is the easiest way to see serialized JSON data (as strings) for in-memory DocumentStore
?
Upvotes: 2
Views: 320
Reputation: 22956
You can do it like this:
static public void WaitForUserToContinueTheTest(
EmbeddableDocumentStore documentStore)
{
if (Debugger.IsAttached == false)
return;
documentStore.DatabaseCommands.Put("Pls Delete Me", null,
RavenJObject.FromObject(new {
StackTrace = new StackTrace(true)
}), new RavenJObject());
documentStore.Configuration.AnonymousUserAccessMode =
AnonymousUserAccessMode.All;
using (var server = new HttpServer(documentStore.Configuration,
documentStore.DocumentDatabase))
{
server.StartListening();
// start the server
Process.Start(documentStore.Configuration.ServerUrl);
do
{
Thread.Sleep(100);
} while (
documentStore.DatabaseCommands.Get("Pls Delete Me") != null &&
Debugger.IsAttached);
}
}
This will opens the server for you, and will let you see everything that happens inside RavenDB.
Upvotes: 5