From 7d0649c3d5dda983b931776d56564617ff4b5683 Mon Sep 17 00:00:00 2001 From: Joe DeCock Date: Sun, 31 Jul 2016 13:47:17 -0700 Subject: [PATCH] Fixed unit tests for datetime serialization with negative local offsets --- .../Unit/Json/Simple/NancySerializationStrategyFixture.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Nancy.Tests/Unit/Json/Simple/NancySerializationStrategyFixture.cs b/test/Nancy.Tests/Unit/Json/Simple/NancySerializationStrategyFixture.cs index 59550d8549..314923f293 100644 --- a/test/Nancy.Tests/Unit/Json/Simple/NancySerializationStrategyFixture.cs +++ b/test/Nancy.Tests/Unit/Json/Simple/NancySerializationStrategyFixture.cs @@ -92,7 +92,8 @@ public void Should_serialize_unspecified_datetime_object() //Then canSerialize.ShouldBeTrue(); - serializedObject.ShouldEqual(string.Format("2014-03-09T17:03:25.2340000+{0}", offset.Hours.ToString("00") + ":" + offset.Minutes.ToString("00"))); + serializedObject.ShouldEqual(string.Format("2014-03-09T17:03:25.2340000{0}:{1}", + offset.Hours.ToString("+00;-00"), offset.Minutes.ToString("00"))); } [Fact] @@ -109,7 +110,8 @@ public void Should_serialize_local_datetime_object() //Then canSerialize.ShouldBeTrue(); - serializedObject.ShouldEqual(string.Format("2014-03-09T17:03:25.2340000+{0}", offset.Hours.ToString("00") + ":" + offset.Minutes.ToString("00"))); + serializedObject.ShouldEqual(string.Format("2014-03-09T17:03:25.2340000{0}:{1}", + offset.Hours.ToString("+00;-00"), offset.Minutes.ToString("00"))); } [Fact]