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();
				}
			}
		}
예제 #2
0
파일: Fixture.cs 프로젝트: jrauber/GH1429
        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());
                }
            }
        }