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); } }
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); } }
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); } }