public async Task stream_by_long_id_hit() { var doc = new LongDoc(); theSession.Store(doc); await theSession.SaveChangesAsync(); var stream = new MemoryStream(); var found = await theSession.Json.StreamById <LongDoc>(doc.Id, stream); found.ShouldBeTrue(); var target = deserialize <LongDoc>(stream); target.Id.ShouldBe(doc.Id); }
public void persist_and_load() { var LongDoc = new LongDoc { Id = 456 }; theSession.Store(LongDoc); theSession.SaveChanges(); using (var session = theStore.OpenSession()) { SpecificationExtensions.ShouldNotBeNull(session.Load <LongDoc>(456)); SpecificationExtensions.ShouldBeNull(session.Load <LongDoc>(222)); } }
public void persist_and_delete() { var LongDoc = new LongDoc { Id = 567 }; theSession.Store(LongDoc); theSession.SaveChanges(); using (var session = theStore.OpenSession()) { session.Delete <LongDoc>((int)LongDoc.Id); session.SaveChanges(); } using (var session = theStore.OpenSession()) { SpecificationExtensions.ShouldBeNull(session.Load <LongDoc>(LongDoc.Id)); } }
public void auto_assign_id_for_0_id() { var doc = new LongDoc { Id = 0 }; theSession.Store(doc); SpecificationExtensions.ShouldBeGreaterThan(doc.Id, 0L); var doc2 = new LongDoc { Id = 0 }; theSession.Store(doc2); doc2.Id.ShouldNotBe(0L); doc2.Id.ShouldNotBe(doc.Id); }