Skip to content

Commit e9739dd

Browse files
committed
Tests for problem of Ticks
1 parent 933fcad commit e9739dd

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Orm/Xtensive.Orm.Tests/Linq/DateTimeAndDateTimeOffset/DateTime/PartsExtractionTest.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2016-2021 Xtensive LLC.
1+
// Copyright (C) 2016-2022 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44
// Created by: Alex Groznov
@@ -188,5 +188,14 @@ public void ExtractDayOfWeekTest()
188188
RunWrongTest<SingleDateTimeEntity>(c => c.NullableDateTime.Value.DayOfWeek == WrongDateTime.DayOfWeek);
189189
});
190190
}
191+
192+
[Test]
193+
public void ExtractTimeOfDayTicksTest()
194+
{
195+
ExecuteInsideSession(() => {
196+
RunTest<SingleDateTimeEntity>(c => c.DateTime.TimeOfDay.Ticks == FirstDateTime.TimeOfDay.Ticks);
197+
RunWrongTest<SingleDateTimeEntity>(c => c.DateTime.TimeOfDay.Ticks < FirstDateTime.TimeOfDay.Ticks);
198+
});
199+
}
191200
}
192201
}

Orm/Xtensive.Orm.Tests/Linq/DateTimeAndDateTimeOffset/DateTimeOffset/PartsExtractionTest.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2016-2021 Xtensive LLC.
1+
// Copyright (C) 2016-2022 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44
// Created by: Alex Groznov
@@ -189,6 +189,18 @@ public void ExtractTimeOfDayWithMillisecondsTest()
189189
});
190190
}
191191

192+
[Test]
193+
public void ExtractTimeOfDayTicksTest()
194+
{
195+
ExecuteInsideSession(() => {
196+
var firstDateTimeOffset = TryMoveToLocalTimeZone(FirstDateTimeOffset);
197+
RunTest<SingleDateTimeOffsetEntity>(c => c.DateTimeOffset.TimeOfDay.Ticks == firstDateTimeOffset.TimeOfDay.Ticks);
198+
199+
var wrongDateTimeOffset = TryMoveToLocalTimeZone(WrongDateTimeOffset);
200+
RunWrongTest<SingleDateTimeOffsetEntity>(c => c.DateTimeOffset.TimeOfDay.Ticks == wrongDateTimeOffset.TimeOfDay.Ticks);
201+
});
202+
}
203+
192204
[Test]
193205
public void ExtractTimeOfDayOfNullableValueTest()
194206
{

0 commit comments

Comments
 (0)