Edit
It turns out that I am storing the document correctly, so the initial part of this question is incorrect, possibly due to my inexperience with RavenDB. However, I still have a question about the possibility of opening RavenDB Management Studio when using the EmbeddableDocumentStore in the unit test.
It seems I have a problem storing documents in an EmbeddableDocumentStore during unit test using NUnit. To check if I am actually storing a document, I am trying to connect to the embedded database.
When I try to open the url http: // computer_name: 8080 / (for some reason raven db always uses the computer name on my computer), the browser loading bar just rotates, and if I stop the unit test and try the URL again. Chrome just gives me a message that it cannot connect. Here is some code for the context.
[TestFixture] public class Test2 : IDisposable { private EmbeddableDocumentStore _documentStore; [SetUp] public void SetUp() { if (_documentStore != null) return; _documentStore = new EmbeddableDocumentStore { DataDirectory = "Data", RunInMemory = true, UseEmbeddedHttpServer = true }; _documentStore.Configuration.AnonymousUserAccessMode = AnonymousUserAccessMode.All; _documentStore.Initialize(); } [Test] public void Test() { var document = StaticData.getdocument(); using (var session = _documentStore.OpenSession()) { session.Store(document); session.SaveChanges(); } using (var session = _documentStore.OpenSession()) { var test = session.Load<ObjectType>().Length;
I also have a Raven.Studio.xap file in the root of my test project.
I use VS2012 and .Net 4.5, if that matters.
source share