示例#1
0
		public void TimeSpanNegative()
		{
			TimeSpan time = TimeSpan.FromDays(-1);
			var entity = new ClassA {Time = time};
			using (ISession s = OpenSession())
			using (ITransaction tx = s.BeginTransaction())
			{
				s.Save(entity);
				tx.Commit();
			}

			using (ISession s = OpenSession())
			{
				Assert.AreEqual(time, s.Get<ClassA>(entity.Id).Time);
			}
		}
示例#2
0
		public void VerifyDaysShouldBeZeroInSmallTimeSpan()
		{
			var time = new TimeSpan(1, 0, 0);
			var entity = new ClassA {Time = time};
			using (ISession s = OpenSession())
			using (ITransaction tx = s.BeginTransaction())
			{
				s.Save(entity);
				tx.Commit();
			}

			using (ISession s = OpenSession())
			{
				Assert.AreEqual(0, s.Get<ClassA>(entity.Id).Time.Days);
			}
		}
示例#3
0
		public void TimeSpanLargerThan2h()
		{
			var time = new TimeSpan(0, 2, 1, 0);
			var entity = new ClassA {Time = time};
			using (ISession s = OpenSession())
			using (ITransaction tx = s.BeginTransaction())
			{
				s.Save(entity);
				tx.Commit();
			}

			using (ISession s = OpenSession())
			{
				Assert.AreEqual(time, s.Get<ClassA>(entity.Id).Time);
			}
		}