From 3bebf5c7659c6d092ee06bbd2de9aa6aa5ba452e Mon Sep 17 00:00:00 2001 From: JamesNK Date: Thu, 9 Feb 2012 11:18:37 +0000 Subject: [PATCH] -Fixed JsonReader.ReadAsDateTimeOffset error message --- Src/Newtonsoft.Json.Tests/Linq/JTokenReaderTest.cs | 2 +- Src/Newtonsoft.Json/Bson/BsonReader.cs | 2 +- Src/Newtonsoft.Json/Linq/JTokenReader.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/Newtonsoft.Json.Tests/Linq/JTokenReaderTest.cs b/Src/Newtonsoft.Json.Tests/Linq/JTokenReaderTest.cs index 36e784eb..1d3a35e9 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JTokenReaderTest.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JTokenReaderTest.cs @@ -133,7 +133,7 @@ namespace Newtonsoft.Json.Tests.Linq } [Test] - [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Error reading date. Expected bytes but got Boolean. Line 1, position 14.")] + [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Error reading date. Expected date but got Boolean. Line 1, position 14.")] public void ReadAsDateTimeOffsetBoolean() { string json = @"{""Offset"":true}"; diff --git a/Src/Newtonsoft.Json/Bson/BsonReader.cs b/Src/Newtonsoft.Json/Bson/BsonReader.cs index 470d1331..061587bd 100644 --- a/Src/Newtonsoft.Json/Bson/BsonReader.cs +++ b/Src/Newtonsoft.Json/Bson/BsonReader.cs @@ -336,7 +336,7 @@ namespace Newtonsoft.Json.Bson if (ReaderIsSerializerInArray()) return null; - throw CreateReaderException(this, "Error reading date. Expected bytes but got {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); + throw CreateReaderException(this, "Error reading date. Expected date but got {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); } #endif diff --git a/Src/Newtonsoft.Json/Linq/JTokenReader.cs b/Src/Newtonsoft.Json/Linq/JTokenReader.cs index 34f84c07..704a804a 100644 --- a/Src/Newtonsoft.Json/Linq/JTokenReader.cs +++ b/Src/Newtonsoft.Json/Linq/JTokenReader.cs @@ -198,7 +198,7 @@ namespace Newtonsoft.Json.Linq if (ReaderIsSerializerInArray()) return null; - throw CreateReaderException(this, "Error reading date. Expected bytes but got {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); + throw CreateReaderException(this, "Error reading date. Expected date but got {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType)); } #endif