Skip to content

Commit

Permalink
refactor: add invariant culture when parsing DateTimeOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Dec 6, 2023
1 parent 68ff008 commit 16bcd1b
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using FluentAssertions;
using Vonage.Common;
using Vonage.Common.Monads;
Expand Down Expand Up @@ -29,9 +30,9 @@ public void ShouldDeserialize200() => this.helper.Serializer
response.State.Should().Be("ACTIVE");
response.SequenceNumber.Should().Be(0);
response.Timestamp.Should().Be(new Timestamp(
DateTimeOffset.Parse("2019-09-03T18:40:24.324Z"),
DateTimeOffset.Parse("2019-09-03T18:40:24.324Z"),
DateTimeOffset.Parse("2019-09-03T18:40:24.324Z")));
DateTimeOffset.Parse("2019-09-03T18:40:24.324Z", CultureInfo.InvariantCulture),
DateTimeOffset.Parse("2019-09-03T18:40:24.324Z", CultureInfo.InvariantCulture),
DateTimeOffset.Parse("2019-09-03T18:40:24.324Z", CultureInfo.InvariantCulture)));
response.Properties.Should().BeEquivalentTo(new Properties(60, "string",
"string", new Dictionary<string, string>
{
Expand All @@ -55,7 +56,8 @@ public void ShouldDeserialize200Minimal() => this.helper.Serializer
response.ImageUrl.Should().BeNone();
response.State.Should().Be("ACTIVE");
response.SequenceNumber.Should().Be(0);
response.Timestamp.Should().Be(new Timestamp(DateTimeOffset.Parse("2023-12-06T06:45:10.390Z"),
response.Timestamp.Should().Be(new Timestamp(
DateTimeOffset.Parse("2023-12-06T06:45:10.390Z", CultureInfo.InvariantCulture),
Maybe<DateTimeOffset>.None, Maybe<DateTimeOffset>.None));
response.Properties.Should().BeNone();
response.Links.Should()
Expand Down

0 comments on commit 16bcd1b

Please sign in to comment.