From 16bcd1b9114720510551535d613a3f1211112010 Mon Sep 17 00:00:00 2001 From: Guillaume Faas Date: Wed, 6 Dec 2023 14:01:52 +0100 Subject: [PATCH] refactor: add invariant culture when parsing DateTimeOffset --- .../CreateConversation/SerializationTest.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Vonage.Test.Unit/Conversations/CreateConversation/SerializationTest.cs b/Vonage.Test.Unit/Conversations/CreateConversation/SerializationTest.cs index cc93ebd2f..e90cbad19 100644 --- a/Vonage.Test.Unit/Conversations/CreateConversation/SerializationTest.cs +++ b/Vonage.Test.Unit/Conversations/CreateConversation/SerializationTest.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using FluentAssertions; using Vonage.Common; using Vonage.Common.Monads; @@ -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 { @@ -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.None, Maybe.None)); response.Properties.Should().BeNone(); response.Links.Should()