Fix tests on environments with different line endings (#1831)

This commit is contained in:
James Newton-King
2018-09-17 03:01:58 -07:00
committed by GitHub
parent d7150871cb
commit 71564ceb16
40 changed files with 54 additions and 55 deletions
@@ -80,7 +80,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""CPU"": ""Intel"",
""PSU"": ""500W"",
""Drives"": [
@@ -116,7 +116,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""channel"": {
""title"": ""Star Wars"",
""link"": ""http://www.starwars.com"",
@@ -69,7 +69,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Cpu"": ""Intel"",
""Memory"": 32,
""Drives"": [
@@ -130,7 +130,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""channel"": {
""title"": ""James Newton-King"",
""link"": ""http://james.newtonking.com"",
@@ -69,7 +69,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""ProductName"": ""Elbow Grease"",
""Enabled"": true,
""Price"": 4.90,
@@ -68,7 +68,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""name1"": ""value1"",
""name2"": [
1,
@@ -69,7 +69,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""name1"": ""value1"",
""name2"": ""value2"",
""name3"": [
@@ -93,7 +93,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// <p>Content!</p>
#endregion
Assert.AreEqual(@"<h3>Title!</h3>
StringAssert.AreEqual(@"<h3>Title!</h3>
<p>Content!</p>", blogPosts[0].Body);
}
}
@@ -100,7 +100,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// ]
#endregion
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
""DVD"",
""SSD""
]", a.ToString());
@@ -85,7 +85,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""channel"": {
""title"": ""STAR WARS"",
""link"": ""http://www.starwars.com"",
@@ -61,7 +61,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// ]
#endregion
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
""Small"",
""Medium"",
""Large""
@@ -65,7 +65,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""CPU"": ""Intel"",
""Drives"": [
""DVD read/writer"",
@@ -72,8 +72,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
AuthorName = "James Newton-King",
AuthorTwitter = "JamesNK",
PostedDate = new DateTime(2013, 1, 23, 19, 30, 0),
Body = @"<h3>Title!</h3>
<p>Content!</p>"
Body = @"<h3>Title!</h3><p>Content!</p>"
}
};
@@ -102,12 +101,12 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// "Twitter": "JamesNK"
// },
// "Date": "2013-01-23T19:30:00",
// "BodyHtml": "&lt;h3&gt;Title!&lt;/h3&gt;\r\n&lt;p&gt;Content!&lt;/p&gt;"
// "BodyHtml": "&lt;h3&gt;Title!&lt;/h3&gt;&lt;p&gt;Content!&lt;/p&gt;"
// }
// ]
#endregion
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
{
""Title"": ""Json.NET is awesome!"",
""Author"": {
@@ -115,7 +114,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
""Twitter"": ""JamesNK""
},
""Date"": ""2013-01-23T19:30:00"",
""BodyHtml"": ""&lt;h3&gt;Title!&lt;/h3&gt;\r\n &lt;p&gt;Content!&lt;/p&gt;""
""BodyHtml"": ""&lt;h3&gt;Title!&lt;/h3&gt;&lt;p&gt;Content!&lt;/p&gt;""
}
]", blogPostsArray.ToString());
}
@@ -108,7 +108,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""LastName"": ""Deepwater-Diver""
}", startingWithL);
}
@@ -113,7 +113,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// ]
#endregion
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
""New Zealand"",
""Australia"",
""Denmark"",
@@ -79,7 +79,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Name"": ""ImportantLegalDocuments.docx"",
""Size"": 51200
}", json);
@@ -96,7 +96,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Name"": ""George Michael Bluth"",
""Age"": 16,
""Title"": ""Mister Manager""
@@ -77,7 +77,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""UserName"": ""domain\\username"",
""Status"": ""Deleted""
}", json);
@@ -76,7 +76,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Name"": ""ImportantLegalDocuments.docx"",
""Size"": 51200
}", json);
@@ -91,7 +91,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Name"": ""My Documents"",
""Files"": [
""ImportantLegalDocuments.docx"",
@@ -104,7 +104,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Name"": ""Acme Ltd."",
""Employees"": [
{
@@ -70,7 +70,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""name"": ""Starcraft"",
""release_date"": ""1998-01-01T00:00:00""
}", json);
@@ -88,7 +88,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""FullName"": ""Aaron Account"",
""EmailAddress"": ""aaron@example.com"",
""CreatedDate"": ""2010-10-01T00:00:00"",
@@ -70,7 +70,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Name"": ""Red October"",
""Class"": ""Typhoon""
}", json);
@@ -82,7 +82,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Name"": ""Nigal Newborn"",
""Age"": 1
}", jsonIgnoreNullValues);
@@ -132,7 +132,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""$id"": ""1"",
""Name"": ""My Documents"",
""Parent"": {
@@ -71,7 +71,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Name"": ""Joe User"",
""Manager"": {
""Name"": ""Mike Manager""
@@ -85,7 +85,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// ]
#endregion
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
{
""Name"": ""Joe Employee"",
""Manager"": {
@@ -77,7 +77,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""firstName"": ""Sarah"",
""lastName"": ""Security"",
""fullName"": ""Sarah Security""
@@ -84,7 +84,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Table1"": [
{
""id"": 0,
@@ -61,7 +61,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""James"": 9001,
""Jo"": 3474,
""Jess"": 11926
@@ -80,7 +80,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
Console.WriteLine(json);
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Email"": ""james@example.com"",
""Active"": true,
""CreatedDate"": ""2013-01-20T00:00:00Z"",
@@ -68,7 +68,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// }
#endregion
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""OnLoadFunction"": OnLoad,
""OnUnloadFunction"": function(e) { alert(e); }
}", json);
@@ -79,7 +79,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Xml
// </Root>
#endregion
Assert.AreEqual(@"<Root Id=""1"">
StringAssert.AreEqual(@"<Root Id=""1"">
<Email>james@example.com</Email>
<Active>true</Active>
<CreatedDate>2013-01-20T00:00:00Z</CreatedDate>