public void Can_Store_And_Retrieve_A_Simple_Instance() { const string id = "Hope"; using (var session = DocumentStore.OpenSession()) { var dummy = new Dummy {CreationTime = DateTime.Now, Id = id, NumberOfCrash = 17}; session.Store(dummy); session.SaveChanges(); } using (var session = DocumentStore.OpenSession()) { var dummy = session.Load<Dummy>(id); Assert.That(dummy,Is.Not.Null); } }
public void Nothing_Is_Stored_If_SaveChanges_Is_Not_Called() { const string id = "NotStored"; using (var session = DocumentStore.OpenSession()) { var dummy = new Dummy { CreationTime = DateTime.Now, Id = id, NumberOfCrash = 17 }; session.Store(dummy); } using (var session = DocumentStore.OpenSession()) { var dummy = session.Load<Dummy>(id); Assert.That(dummy, Is.Null); } }
public void You_can_change_an_existing_document() { var id = Guid.NewGuid(); using (var session = DocumentStore.OpenSession()) { var dummy = new Dummy { CreationTime = DateTime.Now, Id = "NotStored", NumberOfCrash = 17 }; session.Store(dummy); } using (var session = DocumentStore.OpenSession()) { var dummy = session.Load<Dummy>(id); Assert.That(dummy, Is.Null); } }