Fix tests on environments with different line endings (#1831)
This commit is contained in:
@@ -231,7 +231,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
|||||||
};
|
};
|
||||||
|
|
||||||
string json = JsonConvert.SerializeObject(c, Formatting.Indented, new StringEnumConverter());
|
string json = JsonConvert.SerializeObject(c, Formatting.Indented, new StringEnumConverter());
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Enum"": "",third""
|
""Enum"": "",third""
|
||||||
}", json);
|
}", json);
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
|||||||
};
|
};
|
||||||
|
|
||||||
string json = JsonConvert.SerializeObject(c, Formatting.Indented, new StringEnumConverter());
|
string json = JsonConvert.SerializeObject(c, Formatting.Indented, new StringEnumConverter());
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Enum"": "",""
|
""Enum"": "",""
|
||||||
}", json);
|
}", json);
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""CPU"": ""Intel"",
|
""CPU"": ""Intel"",
|
||||||
""PSU"": ""500W"",
|
""PSU"": ""500W"",
|
||||||
""Drives"": [
|
""Drives"": [
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""channel"": {
|
""channel"": {
|
||||||
""title"": ""Star Wars"",
|
""title"": ""Star Wars"",
|
||||||
""link"": ""http://www.starwars.com"",
|
""link"": ""http://www.starwars.com"",
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Cpu"": ""Intel"",
|
""Cpu"": ""Intel"",
|
||||||
""Memory"": 32,
|
""Memory"": 32,
|
||||||
""Drives"": [
|
""Drives"": [
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""channel"": {
|
""channel"": {
|
||||||
""title"": ""James Newton-King"",
|
""title"": ""James Newton-King"",
|
||||||
""link"": ""http://james.newtonking.com"",
|
""link"": ""http://james.newtonking.com"",
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""ProductName"": ""Elbow Grease"",
|
""ProductName"": ""Elbow Grease"",
|
||||||
""Enabled"": true,
|
""Enabled"": true,
|
||||||
""Price"": 4.90,
|
""Price"": 4.90,
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""name1"": ""value1"",
|
""name1"": ""value1"",
|
||||||
""name2"": [
|
""name2"": [
|
||||||
1,
|
1,
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""name1"": ""value1"",
|
""name1"": ""value1"",
|
||||||
""name2"": ""value2"",
|
""name2"": ""value2"",
|
||||||
""name3"": [
|
""name3"": [
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// <p>Content!</p>
|
// <p>Content!</p>
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"<h3>Title!</h3>
|
StringAssert.AreEqual(@"<h3>Title!</h3>
|
||||||
<p>Content!</p>", blogPosts[0].Body);
|
<p>Content!</p>", blogPosts[0].Body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// ]
|
// ]
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"[
|
StringAssert.AreEqual(@"[
|
||||||
""DVD"",
|
""DVD"",
|
||||||
""SSD""
|
""SSD""
|
||||||
]", a.ToString());
|
]", a.ToString());
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""channel"": {
|
""channel"": {
|
||||||
""title"": ""STAR WARS"",
|
""title"": ""STAR WARS"",
|
||||||
""link"": ""http://www.starwars.com"",
|
""link"": ""http://www.starwars.com"",
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// ]
|
// ]
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"[
|
StringAssert.AreEqual(@"[
|
||||||
""Small"",
|
""Small"",
|
||||||
""Medium"",
|
""Medium"",
|
||||||
""Large""
|
""Large""
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""CPU"": ""Intel"",
|
""CPU"": ""Intel"",
|
||||||
""Drives"": [
|
""Drives"": [
|
||||||
""DVD read/writer"",
|
""DVD read/writer"",
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
AuthorName = "James Newton-King",
|
AuthorName = "James Newton-King",
|
||||||
AuthorTwitter = "JamesNK",
|
AuthorTwitter = "JamesNK",
|
||||||
PostedDate = new DateTime(2013, 1, 23, 19, 30, 0),
|
PostedDate = new DateTime(2013, 1, 23, 19, 30, 0),
|
||||||
Body = @"<h3>Title!</h3>
|
Body = @"<h3>Title!</h3><p>Content!</p>"
|
||||||
<p>Content!</p>"
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -102,12 +101,12 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
// "Twitter": "JamesNK"
|
// "Twitter": "JamesNK"
|
||||||
// },
|
// },
|
||||||
// "Date": "2013-01-23T19:30:00",
|
// "Date": "2013-01-23T19:30:00",
|
||||||
// "BodyHtml": "<h3>Title!</h3>\r\n<p>Content!</p>"
|
// "BodyHtml": "<h3>Title!</h3><p>Content!</p>"
|
||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"[
|
StringAssert.AreEqual(@"[
|
||||||
{
|
{
|
||||||
""Title"": ""Json.NET is awesome!"",
|
""Title"": ""Json.NET is awesome!"",
|
||||||
""Author"": {
|
""Author"": {
|
||||||
@@ -115,7 +114,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
|
|||||||
""Twitter"": ""JamesNK""
|
""Twitter"": ""JamesNK""
|
||||||
},
|
},
|
||||||
""Date"": ""2013-01-23T19:30:00"",
|
""Date"": ""2013-01-23T19:30:00"",
|
||||||
""BodyHtml"": ""<h3>Title!</h3>\r\n <p>Content!</p>""
|
""BodyHtml"": ""<h3>Title!</h3><p>Content!</p>""
|
||||||
}
|
}
|
||||||
]", blogPostsArray.ToString());
|
]", blogPostsArray.ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -108,7 +108,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""LastName"": ""Deepwater-Diver""
|
""LastName"": ""Deepwater-Diver""
|
||||||
}", startingWithL);
|
}", startingWithL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// ]
|
// ]
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"[
|
StringAssert.AreEqual(@"[
|
||||||
""New Zealand"",
|
""New Zealand"",
|
||||||
""Australia"",
|
""Australia"",
|
||||||
""Denmark"",
|
""Denmark"",
|
||||||
|
|||||||
+1
-1
@@ -79,7 +79,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""ImportantLegalDocuments.docx"",
|
""Name"": ""ImportantLegalDocuments.docx"",
|
||||||
""Size"": 51200
|
""Size"": 51200
|
||||||
}", json);
|
}", json);
|
||||||
|
|||||||
+1
-1
@@ -96,7 +96,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""George Michael Bluth"",
|
""Name"": ""George Michael Bluth"",
|
||||||
""Age"": 16,
|
""Age"": 16,
|
||||||
""Title"": ""Mister Manager""
|
""Title"": ""Mister Manager""
|
||||||
|
|||||||
+1
-1
@@ -77,7 +77,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""UserName"": ""domain\\username"",
|
""UserName"": ""domain\\username"",
|
||||||
""Status"": ""Deleted""
|
""Status"": ""Deleted""
|
||||||
}", json);
|
}", json);
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""ImportantLegalDocuments.docx"",
|
""Name"": ""ImportantLegalDocuments.docx"",
|
||||||
""Size"": 51200
|
""Size"": 51200
|
||||||
}", json);
|
}", json);
|
||||||
|
|||||||
+1
-1
@@ -91,7 +91,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""My Documents"",
|
""Name"": ""My Documents"",
|
||||||
""Files"": [
|
""Files"": [
|
||||||
""ImportantLegalDocuments.docx"",
|
""ImportantLegalDocuments.docx"",
|
||||||
|
|||||||
+1
-1
@@ -104,7 +104,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""Acme Ltd."",
|
""Name"": ""Acme Ltd."",
|
||||||
""Employees"": [
|
""Employees"": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""name"": ""Starcraft"",
|
""name"": ""Starcraft"",
|
||||||
""release_date"": ""1998-01-01T00:00:00""
|
""release_date"": ""1998-01-01T00:00:00""
|
||||||
}", json);
|
}", json);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""FullName"": ""Aaron Account"",
|
""FullName"": ""Aaron Account"",
|
||||||
""EmailAddress"": ""aaron@example.com"",
|
""EmailAddress"": ""aaron@example.com"",
|
||||||
""CreatedDate"": ""2010-10-01T00:00:00"",
|
""CreatedDate"": ""2010-10-01T00:00:00"",
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""Red October"",
|
""Name"": ""Red October"",
|
||||||
""Class"": ""Typhoon""
|
""Class"": ""Typhoon""
|
||||||
}", json);
|
}", json);
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""Nigal Newborn"",
|
""Name"": ""Nigal Newborn"",
|
||||||
""Age"": 1
|
""Age"": 1
|
||||||
}", jsonIgnoreNullValues);
|
}", jsonIgnoreNullValues);
|
||||||
|
|||||||
+1
-1
@@ -132,7 +132,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""$id"": ""1"",
|
""$id"": ""1"",
|
||||||
""Name"": ""My Documents"",
|
""Name"": ""My Documents"",
|
||||||
""Parent"": {
|
""Parent"": {
|
||||||
|
|||||||
+1
-1
@@ -71,7 +71,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""Joe User"",
|
""Name"": ""Joe User"",
|
||||||
""Manager"": {
|
""Manager"": {
|
||||||
""Name"": ""Mike Manager""
|
""Name"": ""Mike Manager""
|
||||||
|
|||||||
+1
-1
@@ -85,7 +85,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// ]
|
// ]
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"[
|
StringAssert.AreEqual(@"[
|
||||||
{
|
{
|
||||||
""Name"": ""Joe Employee"",
|
""Name"": ""Joe Employee"",
|
||||||
""Manager"": {
|
""Manager"": {
|
||||||
|
|||||||
+1
-1
@@ -77,7 +77,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""firstName"": ""Sarah"",
|
""firstName"": ""Sarah"",
|
||||||
""lastName"": ""Security"",
|
""lastName"": ""Security"",
|
||||||
""fullName"": ""Sarah Security""
|
""fullName"": ""Sarah Security""
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Table1"": [
|
""Table1"": [
|
||||||
{
|
{
|
||||||
""id"": 0,
|
""id"": 0,
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""James"": 9001,
|
""James"": 9001,
|
||||||
""Jo"": 3474,
|
""Jo"": 3474,
|
||||||
""Jess"": 11926
|
""Jess"": 11926
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
Console.WriteLine(json);
|
Console.WriteLine(json);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Email"": ""james@example.com"",
|
""Email"": ""james@example.com"",
|
||||||
""Active"": true,
|
""Active"": true,
|
||||||
""CreatedDate"": ""2013-01-20T00:00:00Z"",
|
""CreatedDate"": ""2013-01-20T00:00:00Z"",
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""OnLoadFunction"": OnLoad,
|
""OnLoadFunction"": OnLoad,
|
||||||
""OnUnloadFunction"": function(e) { alert(e); }
|
""OnUnloadFunction"": function(e) { alert(e); }
|
||||||
}", json);
|
}", json);
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Xml
|
|||||||
// </Root>
|
// </Root>
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"<Root Id=""1"">
|
StringAssert.AreEqual(@"<Root Id=""1"">
|
||||||
<Email>james@example.com</Email>
|
<Email>james@example.com</Email>
|
||||||
<Active>true</Active>
|
<Active>true</Active>
|
||||||
<CreatedDate>2013-01-20T00:00:00Z</CreatedDate>
|
<CreatedDate>2013-01-20T00:00:00Z</CreatedDate>
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ namespace Newtonsoft.Json.Tests.Documentation
|
|||||||
//}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""name"": ""Widget"",
|
""name"": ""Widget"",
|
||||||
""expiryDate"": ""2010-12-20T18:01:00Z"",
|
""expiryDate"": ""2010-12-20T18:01:00Z"",
|
||||||
""price"": 9.99,
|
""price"": 9.99,
|
||||||
@@ -615,7 +615,7 @@ namespace Newtonsoft.Json.Tests.Documentation
|
|||||||
//]
|
//]
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"[
|
StringAssert.AreEqual(@"[
|
||||||
{
|
{
|
||||||
""Name"": ""Product 1"",
|
""Name"": ""Product 1"",
|
||||||
""ExpiryDate"": ""2000-12-29T00:00:00Z"",
|
""ExpiryDate"": ""2000-12-29T00:00:00Z"",
|
||||||
@@ -790,7 +790,7 @@ namespace Newtonsoft.Json.Tests.Documentation
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""Bad Boys III"",
|
""Name"": ""Bad Boys III"",
|
||||||
""Description"": ""It's no Bad Boys"",
|
""Description"": ""It's no Bad Boys"",
|
||||||
""Classification"": null,
|
""Classification"": null,
|
||||||
@@ -799,7 +799,7 @@ namespace Newtonsoft.Json.Tests.Documentation
|
|||||||
""ReleaseCountries"": null
|
""ReleaseCountries"": null
|
||||||
}", included);
|
}", included);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""Bad Boys III"",
|
""Name"": ""Bad Boys III"",
|
||||||
""Description"": ""It's no Bad Boys""
|
""Description"": ""It's no Bad Boys""
|
||||||
}", ignored);
|
}", ignored);
|
||||||
@@ -862,7 +862,7 @@ namespace Newtonsoft.Json.Tests.Documentation
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Company"": ""Acme Ltd."",
|
""Company"": ""Acme Ltd."",
|
||||||
""Amount"": 50.0,
|
""Amount"": 50.0,
|
||||||
""Paid"": false,
|
""Paid"": false,
|
||||||
@@ -871,7 +871,7 @@ namespace Newtonsoft.Json.Tests.Documentation
|
|||||||
""FollowUpEmailAddress"": """"
|
""FollowUpEmailAddress"": """"
|
||||||
}", included);
|
}", included);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Company"": ""Acme Ltd."",
|
""Company"": ""Acme Ltd."",
|
||||||
""Amount"": 50.0
|
""Amount"": 50.0
|
||||||
}", ignored);
|
}", ignored);
|
||||||
@@ -940,13 +940,13 @@ namespace Newtonsoft.Json.Tests.Documentation
|
|||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""AuthorName"": ""Brandon Sanderson"",
|
""AuthorName"": ""Brandon Sanderson"",
|
||||||
""AuthorAge"": 34,
|
""AuthorAge"": 34,
|
||||||
""AuthorCountry"": ""United States of America""
|
""AuthorCountry"": ""United States of America""
|
||||||
}", startingWithA);
|
}", startingWithA);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""BookName"": ""The Gathering Storm"",
|
""BookName"": ""The Gathering Storm"",
|
||||||
""BookPrice"": 16.19
|
""BookPrice"": 16.19
|
||||||
}", startingWithB);
|
}", startingWithB);
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ namespace Newtonsoft.Json.Tests
|
|||||||
|
|
||||||
string result = o.ToString();
|
string result = o.ToString();
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""BodyHtml"": ""<h3>Title!</h3>\r\n <p>Content!</p>""
|
""BodyHtml"": ""<h3>Title!</h3>\r\n <p>Content!</p>""
|
||||||
}", result);
|
}", result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -462,7 +462,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
|
|
||||||
string json = JsonConvert.SerializeObject(d, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(d, Formatting.Indented);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""key"": [
|
""key"": [
|
||||||
{
|
{
|
||||||
""Text1"": ""value1""
|
""Text1"": ""value1""
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
ContractResolver = new DictionaryKeyContractResolver()
|
ContractResolver = new DictionaryKeyContractResolver()
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""NAME"": ""James"",
|
""NAME"": ""James"",
|
||||||
""AGE"": 1,
|
""AGE"": 1,
|
||||||
""ROLENAMES"": {
|
""ROLENAMES"": {
|
||||||
@@ -574,7 +574,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
ContractResolver = new IgnoredPropertiesContractResolver()
|
ContractResolver = new IgnoredPropertiesContractResolver()
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""Name!""
|
""Name"": ""Name!""
|
||||||
}", json);
|
}", json);
|
||||||
|
|
||||||
@@ -2907,7 +2907,7 @@ keyword such as type of business.""
|
|||||||
|
|
||||||
string json = JsonConvert.SerializeObject(o, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(o, Formatting.Indented);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""IEnumerableProperty"": [
|
""IEnumerableProperty"": [
|
||||||
4,
|
4,
|
||||||
5,
|
5,
|
||||||
|
|||||||
@@ -269,12 +269,12 @@ Newtonsoft.Json Error: 0 : Error!
|
|||||||
$('#element')
|
$('#element')
|
||||||
]", json);
|
]", json);
|
||||||
|
|
||||||
Assert.IsTrue(traceWriter.ToString().EndsWith(@"Verbose Serialized JSON:
|
Assert.IsTrue(StringAssert.Normalize(traceWriter.ToString()).EndsWith(StringAssert.Normalize(@"Verbose Serialized JSON:
|
||||||
[
|
[
|
||||||
$('#element'),
|
$('#element'),
|
||||||
$('#element'),
|
$('#element'),
|
||||||
$('#element')
|
$('#element')
|
||||||
]", StringComparison.Ordinal));
|
]"), StringComparison.Ordinal));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
Reference in New Issue
Block a user