Skip to content

Commit

Permalink
requestdata tests datetimeoffset parseexact
Browse files Browse the repository at this point in the history
  • Loading branch information
pimbrouwers committed Jan 28, 2025
1 parent df9213f commit 6d93e78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/Falco.Tests/RequestDataTests.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Falco.Tests.RequestData

open System
open System.Globalization
open System.IO
open System.Threading
open System.Threading.Tasks
Expand Down Expand Up @@ -107,7 +108,7 @@ let ``RequestData value lookups are case-insensitive`` () =
let ``RequestData collection should resolve primitives`` () =
let dt = DateTime(1986, 12, 12)
let dtStr = dt.ToString()
let dtOffsetStr = DateTimeOffset(dt).ToString()
let dtOffsetStr = DateTimeOffset(dt).ToString("yyyy-MM-ddTHH:mm:sszzz")
let timespanStr = TimeSpan.FromSeconds(1.0).ToString()
let guidStr = Guid.NewGuid().ToString()

Expand Down Expand Up @@ -141,7 +142,7 @@ let ``RequestData collection should resolve primitives`` () =
scr.GetFloat "ffloat" |> should equal 1.234
scr.GetDecimal "fdecimal" |> should equal 4.567M
scr.GetDateTime "fdatetime" |> should equal (DateTime.Parse(dtStr))
scr.GetDateTimeOffset "fdatetimeoffset" |> should equal (DateTimeOffset.Parse(dtOffsetStr))
scr.GetDateTimeOffset "fdatetimeoffset" |> should equal (DateTimeOffset.ParseExact(dtOffsetStr, "yyyy-MM-ddTHH:mm:sszzz", CultureInfo.InvariantCulture))
scr.GetTimeSpan "ftimespan" |> should equal (TimeSpan.Parse(timespanStr))
scr.GetGuid "fguid" |> should equal (Guid.Parse(guidStr))

Expand Down

0 comments on commit 6d93e78

Please sign in to comment.