@@ -56,9 +56,10 @@ public static IEnumerable<object[]> NowInputs
5656 {
5757 get
5858 {
59- return new [ ] {
59+ return
60+ [
6061 // Basic "now" anchor
61- new object [ ] { "now" , false , _now } ,
62+ [ "now" , false , _now ] ,
6263 [ "now" , true , _now ] ,
6364
6465 // Now with single operations
@@ -106,7 +107,7 @@ public static IEnumerable<object[]> NowInputs
106107 [ "now-d" , true , _now . AddDays ( - 1 ) ] ,
107108 [ "now+M" , false , _now . AddMonths ( 1 ) ] ,
108109 [ "now-y" , true , _now . AddYears ( - 1 ) ]
109- } ;
110+ ] ;
110111 }
111112 }
112113
@@ -116,9 +117,10 @@ public static IEnumerable<object[]> ExplicitDateInputs
116117 {
117118 var baseDate = new DateTimeOffset ( 2001 , 2 , 1 , 0 , 0 , 0 , _now . Offset ) ;
118119
119- return new [ ] {
120+ return
121+ [
120122 // Basic explicit date formats (officially supported by Elasticsearch)
121- new object [ ] { "2001-02-01||" , false , baseDate } ,
123+ [ "2001-02-01||" , false , baseDate ] ,
122124 [ "2001-02-01||" , true , baseDate ] ,
123125 [ "20010201||" , false , baseDate ] ,
124126 [ "20010201||" , true , baseDate ] ,
@@ -170,17 +172,18 @@ public static IEnumerable<object[]> ExplicitDateInputs
170172 // Basic format variations (yyyyMMdd is officially supported)
171173 [ "20230615||" , false , new DateTimeOffset ( 2023 , 6 , 15 , 0 , 0 , 0 , _now . Offset ) ] ,
172174 [ "20230615||" , true , new DateTimeOffset ( 2023 , 6 , 15 , 0 , 0 , 0 , _now . Offset ) ]
173- } ;
175+ ] ;
174176 }
175177 }
176178
177179 public static IEnumerable < object [ ] > ComplexOperationInputs
178180 {
179181 get
180182 {
181- return new [ ] {
183+ return
184+ [
182185 // Multiple operations
183- new object [ ] { "now+1d+1h" , false , _now . AddDays ( 1 ) . AddHours ( 1 ) } ,
186+ [ "now+1d+1h" , false , _now . AddDays ( 1 ) . AddHours ( 1 ) ] ,
184187 [ "now+1d+1h" , true , _now . AddDays ( 1 ) . AddHours ( 1 ) ] ,
185188 [ "now-1d-1h" , false , _now . AddDays ( - 1 ) . AddHours ( - 1 ) ] ,
186189 [ "now-1d-1h" , true , _now . AddDays ( - 1 ) . AddHours ( - 1 ) ] ,
@@ -208,17 +211,18 @@ public static IEnumerable<object[]> ComplexOperationInputs
208211 // Complex operations with timezone offsets
209212 [ "2023-06-15T10:00:00+05:00||+1d-2h" , false , new DateTimeOffset ( 2023 , 6 , 16 , 8 , 0 , 0 , TimeSpan . FromHours ( 5 ) ) ] ,
210213 [ "2023-06-15T10:00:00+05:00||+1d-2h" , true , new DateTimeOffset ( 2023 , 6 , 16 , 8 , 0 , 0 , TimeSpan . FromHours ( 5 ) ) ]
211- } ;
214+ ] ;
212215 }
213216 }
214217
215218 public static IEnumerable < object [ ] > RoundingInputs
216219 {
217220 get
218221 {
219- return new [ ] {
222+ return
223+ [
220224 // Rounding to different units
221- new object [ ] { "now/d" , false , _now . StartOfDay ( ) } ,
225+ [ "now/d" , false , _now . StartOfDay ( ) ] ,
222226 [ "now/d" , true , _now . EndOfDay ( ) ] ,
223227 [ "now/h" , false , _now . StartOfHour ( ) ] ,
224228 [ "now/h" , true , _now . EndOfHour ( ) ] ,
@@ -244,17 +248,18 @@ public static IEnumerable<object[]> RoundingInputs
244248 // Multiple operations ending with rounding
245249 [ "now+1M-1d/d" , false , _now . AddMonths ( 1 ) . AddDays ( - 1 ) . StartOfDay ( ) ] ,
246250 [ "now+1M-1d/d" , true , _now . AddMonths ( 1 ) . AddDays ( - 1 ) . EndOfDay ( ) ]
247- } ;
251+ ] ;
248252 }
249253 }
250254
251255 public static IEnumerable < object [ ] > EdgeCaseInputs
252256 {
253257 get
254258 {
255- return new [ ] {
259+ return
260+ [
256261 // Case sensitivity
257- new object [ ] { "NOW" , false , _now } ,
262+ [ "NOW" , false , _now ] ,
258263 [ "NOW" , true , _now ] ,
259264 [ "Now" , false , _now ] ,
260265 [ "Now" , true , _now ] ,
@@ -278,17 +283,18 @@ public static IEnumerable<object[]> EdgeCaseInputs
278283 [ "now+1D" , true , null ] ,
279284 [ "now+1HOUR" , false , null ] , // Should fail - single char required
280285 [ "now+1HOUR" , true , null ]
281- } ;
286+ ] ;
282287 }
283288 }
284289
285290 public static IEnumerable < object [ ] > InvalidInputs
286291 {
287292 get
288293 {
289- return new [ ] {
294+ return
295+ [
290296 // Invalid formats
291- new object [ ] { "invalid" , false , null } ,
297+ [ "invalid" , false , null ] ,
292298 [ "invalid" , true , null ] ,
293299 [ "blah" , false , null ] ,
294300 [ "blah blah" , true , null ] ,
@@ -329,7 +335,7 @@ public static IEnumerable<object[]> InvalidInputs
329335 [ "2023-01-32||" , true , null ] ,
330336 [ "2023-02-29||" , false , null ] , // Invalid day for non-leap year
331337 [ "2023-02-29||" , true , null ]
332- } ;
338+ ] ;
333339 }
334340 }
335341}
0 commit comments