public void CompareTest() { ExecuteInsideSession(() => { RunTest <SingleDateTimeOffsetEntity>(c => c.DateTimeOffset > FirstDateTimeOffset.AddHours(-1)); RunTest <SingleDateTimeOffsetEntity>(c => c.MillisecondDateTimeOffset > FirstMillisecondDateTimeOffset.AddMilliseconds(-1)); RunTest <SingleDateTimeOffsetEntity>(c => c.NullableDateTimeOffset > NullableDateTimeOffset.AddYears(-1)); RunTest <SingleDateTimeOffsetEntity>(c => c.DateTimeOffset < FirstDateTimeOffset.AddHours(1)); RunTest <SingleDateTimeOffsetEntity>(c => c.MillisecondDateTimeOffset < FirstMillisecondDateTimeOffset.AddMilliseconds(1)); RunTest <SingleDateTimeOffsetEntity>(c => c.NullableDateTimeOffset < NullableDateTimeOffset.AddYears(1)); RunWrongTest <SingleDateTimeOffsetEntity>(c => c.DateTimeOffset > FirstDateTimeOffset); RunWrongTest <SingleDateTimeOffsetEntity>(c => c.MillisecondDateTimeOffset < FirstMillisecondDateTimeOffset); RunWrongTest <SingleDateTimeOffsetEntity>(c => c.NullableDateTimeOffset > NullableDateTimeOffset.AddSeconds(11)); }); }
public void AddHoursTest() { ExecuteInsideSession(() => { RunTest <SingleDateTimeOffsetEntity>(c => c.DateTimeOffset.AddHours(1) == FirstDateTimeOffset.AddHours(1)); RunTest <SingleDateTimeOffsetEntity>(c => c.MillisecondDateTimeOffset.AddHours(-2) == FirstMillisecondDateTimeOffset.AddHours(-2)); RunTest <SingleDateTimeOffsetEntity>(c => c.NullableDateTimeOffset.Value.AddHours(33) == NullableDateTimeOffset.AddHours(33)); RunWrongTest <SingleDateTimeOffsetEntity>(c => c.DateTimeOffset.AddHours(1) == FirstDateTimeOffset.AddHours(2)); RunWrongTest <SingleDateTimeOffsetEntity>(c => c.MillisecondDateTimeOffset.AddHours(-1) == FirstMillisecondDateTimeOffset.AddHours(-2)); RunWrongTest <SingleDateTimeOffsetEntity>(c => c.NullableDateTimeOffset.Value.AddHours(33) == NullableDateTimeOffset.AddHours(44)); }); }