public void UnsavedMinusOneNoNullReferenceException() { UnsavedValueMinusOne uvmo = new UnsavedValueMinusOne(); uvmo.Name = "TEST"; uvmo.UpdateTimestamp = DateTime.Now; Assert.AreEqual(-1, uvmo.Id); using (ISession s = OpenSession()) { ITransaction tran = s.BeginTransaction(); try { s.SaveOrUpdate(uvmo); tran.Commit(); } catch { tran.Rollback(); } } }
public async Task UnsavedMinusOneNoNullReferenceExceptionAsync() { UnsavedValueMinusOne uvmo = new UnsavedValueMinusOne(); uvmo.Name = "TEST"; uvmo.UpdateTimestamp = DateTime.Now; Assert.AreEqual(-1, uvmo.Id); using (ISession s = OpenSession()) { ITransaction tran = s.BeginTransaction(); try { await(s.SaveOrUpdateAsync(uvmo)); await(tran.CommitAsync()); } catch { await(tran.RollbackAsync()); } } }