File tree Expand file tree Collapse file tree
Orm/Xtensive.Orm.Tests/Linq/DateTimeAndDateTimeOffset Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // Copyright (C) 2016 Xtensive LLC.
2- // All rights reserved .
3- // For conditions of distribution and use, see license .
1+ // Copyright (C) 2016-2021 Xtensive LLC.
2+ // This code is distributed under MIT license terms .
3+ // See the License.txt file in the project root for more information .
44// Created by: Alex Groznov
55// Created: 2016.08.01
66
7+ using System ;
78using NUnit . Framework ;
89using Xtensive . Orm . Tests . Linq . DateTimeAndDateTimeOffset . Model ;
910
@@ -118,6 +119,22 @@ public void ExtractDateTest()
118119 } ) ;
119120 }
120121
122+ [ Test ]
123+ [ TestCase ( "2018-10-30 12:15:32.123" ) ]
124+ [ TestCase ( "2018-10-30 12:15:32.1234" ) ]
125+ [ TestCase ( "2018-10-30 12:15:32.12345" ) ]
126+ [ TestCase ( "2018-10-30 12:15:32.123456" ) ]
127+ [ TestCase ( "2018-10-30 12:15:32.1234567" ) ]
128+ public void ExtractDateFromMicrosecondsTest ( string testValueString )
129+ {
130+ Require . ProviderIs ( StorageProvider . SqlServer ) ;
131+ ExecuteInsideSession ( ( ) => {
132+ var testDateTimeOffset = DateTimeOffset . Parse ( testValueString ) ;
133+ _ = new SingleDateTimeOffsetEntity ( ) { MillisecondDateTimeOffset = testDateTimeOffset } ;
134+ RunTest < SingleDateTimeOffsetEntity > ( c => c . MillisecondDateTimeOffset . Date == testDateTimeOffset . Date ) ;
135+ } ) ;
136+ }
137+
121138 [ Test ]
122139 public void ExtractTimeOfDayTest ( )
123140 {
Original file line number Diff line number Diff line change 1- // Copyright (C) 2016 Xtensive LLC.
2- // All rights reserved .
3- // For conditions of distribution and use, see license .
1+ // Copyright (C) 2016-2021 Xtensive LLC.
2+ // This code is distributed under MIT license terms .
3+ // See the License.txt file in the project root for more information .
44// Created by: Alex Groznov
55// Created: 2016.08.01
66
7+ using System ;
78using NUnit . Framework ;
89using Xtensive . Orm . Tests . Linq . DateTimeAndDateTimeOffset . Model ;
910
@@ -148,6 +149,22 @@ public void ExtractDateTest()
148149 } ) ;
149150 }
150151
152+ [ Test ]
153+ [ TestCase ( "2018-10-30 12:15:32.123 +05:10" ) ]
154+ [ TestCase ( "2018-10-30 12:15:32.1234 +05:10" ) ]
155+ [ TestCase ( "2018-10-30 12:15:32.12345 +05:10" ) ]
156+ [ TestCase ( "2018-10-30 12:15:32.123456 +05:10" ) ]
157+ [ TestCase ( "2018-10-30 12:15:32.1234567 +05:10" ) ]
158+ public void ExtractDateFromMicrosecondsTest ( string testValueString )
159+ {
160+ Require . ProviderIs ( StorageProvider . SqlServer ) ;
161+ ExecuteInsideSession ( ( ) => {
162+ var testDateTimeOffset = DateTimeOffset . Parse ( testValueString ) ;
163+ _ = new SingleDateTimeOffsetEntity ( ) { MillisecondDateTimeOffset = testDateTimeOffset } ;
164+ RunTest < SingleDateTimeOffsetEntity > ( c => c . MillisecondDateTimeOffset . Date == testDateTimeOffset . Date ) ;
165+ } ) ;
166+ }
167+
151168 [ Test ]
152169 public void ExtractTimeOfDayTest ( )
153170 {
You can’t perform that action at this time.
0 commit comments