Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/Newtonsoft.Json.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamesNK <james@newtonking.com>2012-01-19 09:48:24 +0400
committerJamesNK <james@newtonking.com>2012-01-19 09:48:24 +0400
commita9e100e0a72ed6ee6ea90ec0b24d6021ff5fdfb8 (patch)
treeaf6eb7f544a9434bbcde99ae63456bd7a356467d /Src/Newtonsoft.Json.Tests
parentb146481c8742e63bd7ad7170f59634aad5878509 (diff)
-Added line number information to deserialization errors
-Added BinaryReader/BinaryWriter constructor overloads to BsonReader/BsonWriter
Diffstat (limited to 'Src/Newtonsoft.Json.Tests')
-rw-r--r--Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs18
-rw-r--r--Src/Newtonsoft.Json.Tests/PerformanceTests.cs4
-rw-r--r--Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs2
-rw-r--r--Src/Newtonsoft.Json.Tests/Serialization/ConstructorHandlingTests.cs2
-rw-r--r--Src/Newtonsoft.Json.Tests/Serialization/DynamicTests.cs2
-rw-r--r--Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs34
-rw-r--r--Src/Newtonsoft.Json.Tests/Serialization/MissingMemberHandlingTests.cs6
-rw-r--r--Src/Newtonsoft.Json.Tests/Serialization/PopulateTests.cs2
-rw-r--r--Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs4
-rw-r--r--Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs2
-rw-r--r--Src/Newtonsoft.Json.Tests/Serialization/TypeNameHandlingTests.cs2
11 files changed, 39 insertions, 39 deletions
diff --git a/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs b/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs
index 9be99ab..b07921f 100644
--- a/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs
+++ b/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs
@@ -553,7 +553,7 @@ Parameter name: reader")]
}
[Test]
- [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading bytes: Line 1, position 3.")]
+ [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading bytes. Line 1, position 3.")]
public void ReadBytesNoStartWithUnexpectedEnd()
{
JsonReader reader = new JsonTextReader(new StringReader(@"[ "));
@@ -562,7 +562,7 @@ Parameter name: reader")]
}
[Test]
- [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when parsing unquoted property name. Line 1, position 4.")]
+ [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end while parsing unquoted property name. Line 1, position 4.")]
public void UnexpectedEndWhenParsingUnquotedProperty()
{
JsonReader reader = new JsonTextReader(new StringReader(@"{aww"));
@@ -1086,7 +1086,7 @@ bye", reader.Value);
}
[Test]
- [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading decimal: Line 0, position 0.")]
+ [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading decimal. Line 0, position 0.")]
public void ReadAsDecimalNoContent()
{
JsonTextReader reader = new JsonTextReader(new StringReader(@""));
@@ -1095,7 +1095,7 @@ bye", reader.Value);
}
[Test]
- [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading bytes: Line 0, position 0.")]
+ [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading bytes. Line 0, position 0.")]
public void ReadAsBytesNoContent()
{
JsonTextReader reader = new JsonTextReader(new StringReader(@""));
@@ -1104,7 +1104,7 @@ bye", reader.Value);
}
[Test]
- [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading bytes: Line 1, position 1.")]
+ [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading bytes. Line 1, position 1.")]
public void ReadAsBytesNoContentWrappedObject()
{
JsonTextReader reader = new JsonTextReader(new StringReader(@"{"));
@@ -1114,7 +1114,7 @@ bye", reader.Value);
#if !NET20
[Test]
- [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading date: Line 0, position 0.")]
+ [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading date. Line 0, position 0.")]
public void ReadAsDateTimeOffsetNoContent()
{
JsonTextReader reader = new JsonTextReader(new StringReader(@""));
@@ -1164,7 +1164,7 @@ bye", reader.Value);
}
[Test]
- [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading bytes: Line 1, position 2.")]
+ [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end when reading bytes. Line 1, position 2.")]
public void ReadAsBytesIntegerArrayWithNoEnd()
{
JsonTextReader reader = new JsonTextReader(new StringReader(@"[1"));
@@ -1341,7 +1341,7 @@ bye", reader.Value);
}
[Test]
- [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end while parsing comment.")]
+ [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end while parsing comment. Line 1, position 6.")]
public void UnclosedComment()
{
JsonTextReader reader = new JsonTextReader(new StringReader(@"/* sdf"));
@@ -1598,7 +1598,7 @@ bye", reader.Value);
}
[Test]
- [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end while parsing constructor.")]
+ [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "Unexpected end while parsing constructor. Line 1, position 7.")]
public void ParseConstructorWithUnexpectedEnd()
{
string json = "new Dat";
diff --git a/Src/Newtonsoft.Json.Tests/PerformanceTests.cs b/Src/Newtonsoft.Json.Tests/PerformanceTests.cs
index 97af7d1..11e0dc1 100644
--- a/Src/Newtonsoft.Json.Tests/PerformanceTests.cs
+++ b/Src/Newtonsoft.Json.Tests/PerformanceTests.cs
@@ -36,8 +36,8 @@ namespace Newtonsoft.Json.Tests
public class PerformanceTests : TestFixtureBase
{
- //private const int Iterations = 100;
- private const int Iterations = 5000;
+ private const int Iterations = 100;
+ //private const int Iterations = 5000;
private static SimpleObject CreateSimpleObject()
{
diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
index ff6fcb5..7923661 100644
--- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
+++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
@@ -66,5 +66,5 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.5.0")]
#if !PocketPC
-[assembly: AssemblyFileVersion("4.0.5.14518")]
+[assembly: AssemblyFileVersion("4.0.5.14519")]
#endif
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/ConstructorHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/ConstructorHandlingTests.cs
index 3f2a78e..1f8ade6 100644
--- a/Src/Newtonsoft.Json.Tests/Serialization/ConstructorHandlingTests.cs
+++ b/Src/Newtonsoft.Json.Tests/Serialization/ConstructorHandlingTests.cs
@@ -7,7 +7,7 @@ namespace Newtonsoft.Json.Tests.Serialization
public class ConstructorHandlingTests : TestFixtureBase
{
[Test]
- [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Unable to find a constructor to use for type Newtonsoft.Json.Tests.TestObjects.PrivateConstructorTestClass. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Unable to find a constructor to use for type Newtonsoft.Json.Tests.TestObjects.PrivateConstructorTestClass. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Line 1, position 6.")]
public void FailWithPrivateConstructorAndDefault()
{
string json = @"{Name:""Name!""}";
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/DynamicTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/DynamicTests.cs
index 501a3a8..b54690c 100644
--- a/Src/Newtonsoft.Json.Tests/Serialization/DynamicTests.cs
+++ b/Src/Newtonsoft.Json.Tests/Serialization/DynamicTests.cs
@@ -185,7 +185,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
[Test]
- [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Unable to find a default constructor to use for type System.Dynamic.DynamicObject.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Unable to find a default constructor to use for type System.Dynamic.DynamicObject. Line 2, position 18.")]
public void NoPublicDefaultConstructor()
{
var settings = new JsonSerializerSettings();
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs
index 7d5d738..13b8783 100644
--- a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs
+++ b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs
@@ -1044,7 +1044,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = "Required property 'FirstName' expects a value but got null.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Required property 'FirstName' expects a value but got null. Line 6, position 2.")]
public void DeserializeRequiredMembersClassNullRequiredValueProperty()
{
string json = @"{
@@ -1074,7 +1074,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = "Required property 'LastName' not found in JSON.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Required property 'LastName' not found in JSON. Line 3, position 2.")]
public void RequiredMembersClassMissingRequiredProperty()
{
string json = @"{
@@ -1160,7 +1160,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = @"Could not create an instance of type Newtonsoft.Json.Tests.TestObjects.ICo. Type is an interface or abstract class and cannot be instantated.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Could not create an instance of type Newtonsoft.Json.Tests.TestObjects.ICo. Type is an interface or abstract class and cannot be instantated. Line 1, position 14.")]
public void DeserializeInterfaceProperty()
{
InterfacePropertyTestClass testClass = new InterfacePropertyTestClass();
@@ -1832,7 +1832,7 @@ keyword such as type of business.""
#endif
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = @"Unable to find a constructor to use for type Newtonsoft.Json.Tests.TestObjects.Event. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Unable to find a constructor to use for type Newtonsoft.Json.Tests.TestObjects.Event. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Line 1, position 15.")]
public void FailWhenClassWithNoDefaultConstructorHasMultipleConstructorsWithArguments()
{
string json = @"{""sublocation"":""AlertEmailSender.Program.Main"",""userId"":0,""type"":0,""summary"":""Loading settings variables"",""details"":null,""stackTrace"":"" at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)\r\n at System.Environment.get_StackTrace()\r\n at mr.Logging.Event..ctor(String summary) in C:\\Projects\\MRUtils\\Logging\\Event.vb:line 71\r\n at AlertEmailSender.Program.Main(String[] args) in C:\\Projects\\AlertEmailSender\\AlertEmailSender\\Program.cs:line 25"",""tag"":null,""time"":""\/Date(1249591032026-0400)\/""}";
@@ -1872,7 +1872,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = @"Cannot deserialize JSON array into type 'Newtonsoft.Json.Tests.TestObjects.Person'.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Cannot deserialize JSON array into type 'Newtonsoft.Json.Tests.TestObjects.Person'. Line 1, position 1.")]
public void CannotDeserializeArrayIntoObject()
{
string json = @"[]";
@@ -1881,7 +1881,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = @"Cannot deserialize JSON object into type 'System.Collections.Generic.List`1[Newtonsoft.Json.Tests.TestObjects.Person]'.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Cannot deserialize JSON object into type 'System.Collections.Generic.List`1[Newtonsoft.Json.Tests.TestObjects.Person]'. Line 1, position 2.")]
public void CannotDeserializeObjectIntoArray()
{
string json = @"{}";
@@ -1890,7 +1890,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = @"Cannot populate JSON array onto type 'Newtonsoft.Json.Tests.TestObjects.Person'.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Cannot populate JSON array onto type 'Newtonsoft.Json.Tests.TestObjects.Person'. Line 1, position 1.")]
public void CannotPopulateArrayIntoObject()
{
string json = @"[]";
@@ -1899,7 +1899,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = @"Cannot populate JSON object onto type 'System.Collections.Generic.List`1[Newtonsoft.Json.Tests.TestObjects.Person]'.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Cannot populate JSON object onto type 'System.Collections.Generic.List`1[Newtonsoft.Json.Tests.TestObjects.Person]'. Line 1, position 2.")]
public void CannotPopulateObjectIntoArray()
{
string json = @"{}";
@@ -1931,14 +1931,14 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = @"Error converting value """" to type 'System.Int32'.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Error converting value """" to type 'System.Int32'. Line 1, position 15.")]
public void DeserializeEnsureTypeEmptyStringToIntError()
{
JsonConvert.DeserializeObject<MemoryStream>("{ReadTimeout:''}");
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = @"Error converting value {null} to type 'System.Int32'.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Error converting value {null} to type 'System.Int32'. Line 1, position 17.")]
public void DeserializeEnsureTypeNullToIntError()
{
JsonConvert.DeserializeObject<MemoryStream>("{ReadTimeout:null}");
@@ -2053,7 +2053,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = "Could not convert string 'Newtonsoft.Json.Tests.TestObjects.Person' to dictionary key type 'Newtonsoft.Json.Tests.TestObjects.Person'. Create a TypeConverter to convert from the string to the key type object.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Could not convert string 'Newtonsoft.Json.Tests.TestObjects.Person' to dictionary key type 'Newtonsoft.Json.Tests.TestObjects.Person'. Create a TypeConverter to convert from the string to the key type object. Line 2, position 46.")]
public void DeserializePersonKeyedDictionary()
{
string json =
@@ -2318,7 +2318,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = "Unable to find a default constructor to use for type Newtonsoft.Json.Tests.Serialization.JsonSerializerTest+DictionaryWithNoDefaultConstructor.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Unable to find a default constructor to use for type Newtonsoft.Json.Tests.Serialization.JsonSerializerTest+DictionaryWithNoDefaultConstructor. Line 1, position 6.")]
public void DeserializeDictionaryWithNoDefaultConstructor()
{
string json = "{key1:'value',key2:'value',key3:'value'}";
@@ -3267,7 +3267,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = "Additional content found in JSON reference object. A JSON reference object should only have a $ref property.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Additional content found in JSON reference object. A JSON reference object should only have a $ref property. Line 6, position 11.")]
public void SerializeRefAdditionalContent()
{
//Additional text found in JSON string after finishing deserializing object.
@@ -3281,12 +3281,12 @@ keyword such as type of business.""
child.Add("Name", "Isabell");
child.Add("Father", reference);
- var json = JsonConvert.SerializeObject(child);
+ var json = JsonConvert.SerializeObject(child, Formatting.Indented);
JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = "JSON reference $ref property must have a string or null value.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "JSON reference $ref property must have a string or null value. Line 5, position 14.")]
public void SerializeRefBadType()
{
//Additional text found in JSON string after finishing deserializing object.
@@ -3300,7 +3300,7 @@ keyword such as type of business.""
child.Add("Name", "Isabell");
child.Add("Father", reference);
- var json = JsonConvert.SerializeObject(child);
+ var json = JsonConvert.SerializeObject(child, Formatting.Indented);
JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
}
@@ -4280,7 +4280,7 @@ keyword such as type of business.""
}
[Test]
- [ExpectedException(typeof (JsonSerializationException), ExpectedMessage = "Error converting value {null} to type 'System.DateTime'.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Error converting value {null} to type 'System.DateTime'. Line 1, position 4.")]
public void DeserializeNullDateTimeValueTest()
{
JsonConvert.DeserializeObject("null", typeof (DateTime));
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/MissingMemberHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/MissingMemberHandlingTests.cs
index 3e2b2fa..5cdcf33 100644
--- a/Src/Newtonsoft.Json.Tests/Serialization/MissingMemberHandlingTests.cs
+++ b/Src/Newtonsoft.Json.Tests/Serialization/MissingMemberHandlingTests.cs
@@ -34,7 +34,7 @@ namespace Newtonsoft.Json.Tests.Serialization
public class MissingMemberHandlingTests : TestFixtureBase
{
[Test]
- [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Could not find member 'Price' on object of type 'ProductShort'")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Could not find member 'Price' on object of type 'ProductShort'. Line 4, position 11.")]
public void MissingMemberDeserialize()
{
Product product = new Product();
@@ -44,7 +44,7 @@ namespace Newtonsoft.Json.Tests.Serialization
product.Price = 3.99M;
product.Sizes = new string[] { "Small", "Medium", "Large" };
- string output = JsonConvert.SerializeObject(product);
+ string output = JsonConvert.SerializeObject(product, Formatting.Indented);
//{
// "Name": "Apple",
// "ExpiryDate": new Date(1230422400000),
@@ -115,7 +115,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
[Test]
- [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Could not find member 'Missing' on object of type 'DoubleClass'")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Could not find member 'Missing' on object of type 'DoubleClass'. Line 1, position 11.")]
public void MissingMemeber()
{
string json = @"{""Missing"":1}";
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/PopulateTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/PopulateTests.cs
index c63445d..f00a40a 100644
--- a/Src/Newtonsoft.Json.Tests/Serialization/PopulateTests.cs
+++ b/Src/Newtonsoft.Json.Tests/Serialization/PopulateTests.cs
@@ -134,7 +134,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
[Test]
- [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Unexpected initial token 'Integer' when populating object. Expected JSON object or array.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Unexpected initial token 'Integer' when populating object. Expected JSON object or array. Line 1, position 1.")]
public void PopulateWithBadJson()
{
JsonConvert.PopulateObject("1", new Person());
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs
index cb72ffb..40f5251 100644
--- a/Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs
+++ b/Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs
@@ -202,7 +202,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
[Test]
- [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Cannot preserve reference to array or readonly list: System.String[][]")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Cannot preserve reference to array or readonly list: System.String[][]. Line 3, position 15.")]
public void DeserializeArraysWithPreserveObjectReferences()
{
string json = @"{
@@ -268,7 +268,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
[Test]
- [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Unexpected end when deserializing object.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Unexpected end when deserializing object. Line 2, position 9.")]
public void UnexpectedEnd()
{
string json = @"{
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs
index 70f1494..61e76d8 100644
--- a/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs
+++ b/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs
@@ -288,7 +288,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
Assert.AreEqual(1, errors.Count);
- Assert.AreEqual(@"Error converting value ""kjhkjhkjhkjh"" to type 'System.DateTime'.", errors[0]);
+ Assert.AreEqual(@"Error converting value ""kjhkjhkjhkjh"" to type 'System.DateTime'. Line 1, position 16.", errors[0]);
}
}
} \ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/TypeNameHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/TypeNameHandlingTests.cs
index 9c38696..e256e0d 100644
--- a/Src/Newtonsoft.Json.Tests/Serialization/TypeNameHandlingTests.cs
+++ b/Src/Newtonsoft.Json.Tests/Serialization/TypeNameHandlingTests.cs
@@ -291,7 +291,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
[Test]
- [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Type specified in JSON 'Newtonsoft.Json.Tests.TestObjects.Employee' was not resolved.")]
+ [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = "Type specified in JSON 'Newtonsoft.Json.Tests.TestObjects.Employee' was not resolved. Line 3, position 56.")]
public void DeserializeTypeNameOnly()
{
string json = @"{