public async System.Threading.Tasks.Task WithBidiTrueOneToOneAsync() { using (ISession session = OpenSession()) using (var trx = session.BeginTransaction()) { var worker = new PersonTrueO2O(); var homestay = new PersonTrueO2O(); var home = new AddressTrueO2O(); var office = new AddressTrueO2O(); home.SetPerson(homestay); office.SetPerson(worker); await(session.SaveAsync(home)); await(session.SaveAsync(office)); Assert.DoesNotThrowAsync(() => { return(trx.CommitAsync()); }); } // 2 Person inserts, 2 Address inserts Assert.AreEqual(2, StatsBatcher.BatchSizes.Count, "Unexpected batches count"); Assert.AreEqual(4, StatsBatcher.BatchSizes.Sum(), "Unexpected batched queries count"); }
public void WithBidiTrueOneToOne() { using (ISession session = OpenSession()) using (var trx = session.BeginTransaction()) { var worker = new PersonTrueO2O(); var homestay = new PersonTrueO2O(); var home = new AddressTrueO2O(); var office = new AddressTrueO2O(); home.SetPerson(homestay); office.SetPerson(worker); session.Save(home); session.Save(office); Assert.DoesNotThrow(() => { trx.Commit(); }); } // 2 Person inserts, 2 Address inserts Assert.AreEqual(2, StatsBatcher.BatchSizes.Count, "Unexpected batches count"); Assert.AreEqual(4, StatsBatcher.BatchSizes.Sum(), "Unexpected batched queries count"); }