From: Adeel Mujahid Date: Tue, 20 Aug 2019 14:48:21 +0000 (+0300) Subject: Use UTC date in Json{Object,String}Tests which use MinValue X-Git-Tag: submit/tizen/20210909.063632~11031^2~634 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f0d371c8bada12bdbb1f1210deea74cb1f09506;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Use UTC date in Json{Object,String}Tests which use MinValue Commit migrated from https://github.com/dotnet/corefx/commit/4f7dc2e9d56035d514caa92b9a61d5c03f28c3d8 --- diff --git a/src/libraries/System.Text.Json/tests/JsonObjectTests.cs b/src/libraries/System.Text.Json/tests/JsonObjectTests.cs index 776b5e5..9759d05 100644 --- a/src/libraries/System.Text.Json/tests/JsonObjectTests.cs +++ b/src/libraries/System.Text.Json/tests/JsonObjectTests.cs @@ -142,7 +142,7 @@ namespace System.Text.Json.Tests [Fact] public static void TestDateTimeOffset() { - DateTimeOffset dateTimeOffset = new DateTime(DateTime.MinValue.Ticks); + DateTimeOffset dateTimeOffset = new DateTime(DateTime.MinValue.Ticks, DateTimeKind.Utc); var jsonObject = new JsonObject { { "dateTimeOffset", dateTimeOffset } }; Assert.Equal(dateTimeOffset.ToString(), (JsonString)jsonObject["dateTimeOffset"]); } diff --git a/src/libraries/System.Text.Json/tests/JsonStringTests.cs b/src/libraries/System.Text.Json/tests/JsonStringTests.cs index 1dde1e6..422c214 100644 --- a/src/libraries/System.Text.Json/tests/JsonStringTests.cs +++ b/src/libraries/System.Text.Json/tests/JsonStringTests.cs @@ -90,7 +90,7 @@ namespace System.Text.Json.Tests [Fact] public static void TestDateTimeOffset() { - DateTimeOffset dateTimeOffset = new DateTime(DateTime.MinValue.Ticks); + DateTimeOffset dateTimeOffset = new DateTime(DateTime.MinValue.Ticks, DateTimeKind.Utc); var jsonString = new JsonString(dateTimeOffset); Assert.Equal(dateTimeOffset.ToString(), jsonString); }