File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -279,6 +279,33 @@ public void can_handle_datetime_comparison_with_timezone()
279279 var filterExpression = FilterParser . ParseFilter < TestingPerson > ( input ) ;
280280 filterExpression . ToString ( ) . Should ( ) . Be ( "x => (x.SpecificDate == 7/1/2022 12:00:03 AM +01:00)" ) ;
281281 }
282+
283+ [ Theory ]
284+ [ InlineData ( "yyyy-MM-ddTHH:mm:ssZ" ) ]
285+ [ InlineData ( "yyyy-MM-ddTHH:mm:sszzz" ) ]
286+ public void can_handle_date_time_offset_another ( string format )
287+ {
288+ var dateTimeOffset = DateTimeOffset . Parse ( "2022-07-01T00:00:03Z" ) . ToString ( format ) ;
289+ var input = $ """ SpecificDate == "{ dateTimeOffset } " """ ;
290+ var filterExpression = FilterParser . ParseFilter < TestingPerson > ( input ) ;
291+ filterExpression . ToString ( ) . Should ( ) . Be ( """"x => (x.SpecificDate == 7/1/2022 12:00:03 AM +00:00)"""" ) ;
292+ }
293+
294+ [ Fact ]
295+ public void can_handle_datetime_another ( )
296+ {
297+ var input = """SpecificDateTime == "2022-07-01T00:00:03" """ ;
298+ var filterExpression = FilterParser . ParseFilter < TestingPerson > ( input ) ;
299+ filterExpression . ToString ( ) . Should ( ) . Be ( """"x => (x.SpecificDateTime == 7/1/2022 12:00:03 AM)"""" ) ;
300+ }
301+
302+ [ Fact ]
303+ public void can_handle_datetime_comparison_with_timezone_another ( )
304+ {
305+ var input = """SpecificDate == "2022-07-01T00:00:03+01:00" """ ;
306+ var filterExpression = FilterParser . ParseFilter < TestingPerson > ( input ) ;
307+ filterExpression . ToString ( ) . Should ( ) . Be ( "x => (x.SpecificDate == 7/1/2022 12:00:03 AM +01:00)" ) ;
308+ }
282309
283310 [ Fact ]
284311 public void can_handle_time_only ( )
You can’t perform that action at this time.
0 commit comments