Exemplo n.º 1
0
        public void SubstractDateTimeOffsetAndIntervalUsageTest()
        {
            ExecuteInsideSession(() => {
                RunTest <SingleDateTimeOffsetEntity>(c => c.DateTimeOffset.Subtract(SecondDateTimeOffset).TotalMilliseconds == FirstDateTimeOffset.Subtract(SecondDateTimeOffset).TotalMilliseconds);
                RunTest <SingleDateTimeOffsetEntity>(c => c.MillisecondDateTimeOffset.Subtract(FirstDateTimeOffset).TotalMilliseconds == FirstMillisecondDateTimeOffset.Subtract(FirstDateTimeOffset).TotalMilliseconds);
                RunTest <SingleDateTimeOffsetEntity>(c => c.NullableDateTimeOffset.Value.Subtract(SecondDateTimeOffset).TotalMilliseconds == NullableDateTimeOffset.Subtract(SecondDateTimeOffset).TotalMilliseconds);

                RunWrongTest <SingleDateTimeOffsetEntity>(c => c.DateTimeOffset.Subtract(SecondDateTimeOffset).TotalMilliseconds == FirstDateTimeOffset.Subtract(WrongDateTimeOffset).TotalMilliseconds);
                RunWrongTest <SingleDateTimeOffsetEntity>(c => c.MillisecondDateTimeOffset.Subtract(SecondDateTimeOffset).TotalMilliseconds == FirstMillisecondDateTimeOffset.Subtract(WrongDateTimeOffset).TotalMilliseconds);
                RunWrongTest <SingleDateTimeOffsetEntity>(c => c.NullableDateTimeOffset.Value.Subtract(SecondDateTimeOffset).TotalMilliseconds == NullableDateTimeOffset.Subtract(WrongDateTimeOffset).TotalMilliseconds);
            });
        }
Exemplo n.º 2
0
        public void SubtractDateTimeTest()
        {
            ExecuteInsideSession(() => {
                RunTest <SingleDateTimeOffsetEntity>(c => c.DateTimeOffset.Subtract(SecondDateTime) == FirstDateTimeOffset.Subtract(SecondDateTime));
                RunTest <SingleDateTimeOffsetEntity>(c => c.MillisecondDateTimeOffset.Subtract(SecondDateTime) == FirstMillisecondDateTimeOffset.Subtract(SecondDateTime));
                RunTest <SingleDateTimeOffsetEntity>(c => c.NullableDateTimeOffset.Value.Subtract(SecondDateTime) == NullableDateTimeOffset.Subtract(SecondDateTime));

                RunWrongTest <SingleDateTimeOffsetEntity>(c => c.DateTimeOffset.Subtract(SecondDateTime) == FirstDateTimeOffset.Subtract(WrongDateTime));
                RunWrongTest <SingleDateTimeOffsetEntity>(c => c.MillisecondDateTimeOffset.Subtract(SecondDateTime) == FirstMillisecondDateTimeOffset.Subtract(WrongDateTime));
                RunWrongTest <SingleDateTimeOffsetEntity>(c => c.NullableDateTimeOffset.Value.Subtract(SecondDateTime) == NullableDateTimeOffset.Subtract(WrongDateTime));
            });
        }