-Tests line endings

This commit is contained in:
James Newton-King
2014-09-12 23:34:20 +12:00
parent a09c2110e8
commit 99df43eb4d
46 changed files with 434 additions and 414 deletions
@@ -815,7 +815,7 @@ namespace Newtonsoft.Json.Tests.Linq
// "StockValue": 22050.00
// }
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""ProductName"": ""Elbow Grease (SALE)"",
""Enabled"": true,
""Price"": 2.45,
@@ -396,7 +396,7 @@ Parameter name: index");
string result = "myOptions = " + optionValues.ToString();
Assert.AreEqual(@"myOptions = {
StringAssert.AreEqual(@"myOptions = {
""options"": [
{
""text"": ""Zero text"",
+9 -21
View File
@@ -67,7 +67,7 @@ namespace Newtonsoft.Json.Tests.Linq
string output = o.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""title"": null
}", output);
@@ -101,7 +101,7 @@ namespace Newtonsoft.Json.Tests.Linq
var o = new JObject();
o.Add(new JProperty("novalue"));
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""novalue"": null
}", o.ToString());
}
@@ -482,7 +482,7 @@ Parameter name: arrayIndex");
string json = o.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""val1"": 1,
""val2"": 1
}", json);
@@ -537,7 +537,7 @@ Parameter name: arrayIndex");
string output = o.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""title"": null
}", output);
}
@@ -618,24 +618,12 @@ Parameter name: arrayIndex");
JObject o = new JObject();
o["rc"] = new JValue(200);
o["m"] = new JValue("");
o["o"] = new JValue(@"<div class='s1'>
<div class='avatar'>
<a href='asdf'>asdf</a><br />
<strong>0</strong>
</div>
<div class='sl'>
<p>
444444444
</p>
</div>
<div class='clear'>
</div>
</div>");
o["o"] = new JValue(@"<div class='s1'>" + StringUtils.CarriageReturnLineFeed + @"</div>");
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""rc"": 200,
""m"": """",
""o"": ""<div class='s1'>\r\n <div class='avatar'> \r\n <a href='asdf'>asdf</a><br />\r\n <strong>0</strong>\r\n </div>\r\n <div class='sl'>\r\n <p>\r\n 444444444\r\n </p>\r\n </div>\r\n <div class='clear'>\r\n </div> \r\n</div>""
""o"": ""<div class='s1'>\r\n</div>""
}", o.ToString());
}
@@ -1590,7 +1578,7 @@ Parameter name: arrayIndex");
string output = o.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""title"": null
}", output);
}
@@ -1659,7 +1647,7 @@ Parameter name: arrayIndex");
JObject o = (JObject)JToken.ReadFrom(reader);
Assert.IsNotNull(o);
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""code"": 0,
""msg"": ""No action taken""
}", o.ToString(Formatting.Indented));
@@ -842,7 +842,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = a.ToString(Formatting.Indented, new IsoDateTimeConverter());
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
""2009-02-15T00:00:00Z""
]", json);
@@ -145,7 +145,7 @@ namespace Newtonsoft.Json.Tests.Linq
writer.WriteComment("fail");
writer.WriteEndArray();
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
/*fail*/]", writer.Token.ToString());
}
@@ -164,7 +164,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(new BigInteger(123), i.Value);
Assert.AreEqual(JTokenType.Integer, i.Type);
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
123
]", writer.Token.ToString());
}
@@ -183,7 +183,7 @@ namespace Newtonsoft.Json.Tests.Linq
// this is a bug. write raw shouldn't be autocompleting like this
// hard to fix without introducing Raw and RawValue token types
// meh
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
fail,
fail
]", writer.Token.ToString());
@@ -199,7 +199,7 @@ namespace Newtonsoft.Json.Tests.Linq
writer.WriteRawValue("fail");
writer.WriteEndArray();
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
fail,
fail
]", writer.Token.ToString());
@@ -399,7 +399,7 @@ namespace Newtonsoft.Json.Tests.Linq
var jTokenWriter = new JTokenWriter();
new JsonSerializer().Serialize(jTokenWriter, rate);
string json = jTokenWriter.Token.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Compoundings"": 12.166666666666666666666666667
}", json);
}
@@ -688,7 +688,7 @@ namespace Newtonsoft.Json.Tests.Linq
new JValue(1.1f)
);
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
""2013-02-01T01:02:03.004+01:00"",
5,
1.1
@@ -744,7 +744,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = o.ToString(Formatting.Indented, new ReadOnlyStringConverter());
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""name"": ""Hello World""
}", json);
}
@@ -360,7 +360,7 @@ keyword such as type of business.""
JObject o = JObject.Parse(json);
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""CPU"": ""Intel"",
""Drives"": [
""DVD read/writer"",
@@ -370,7 +370,7 @@ keyword such as type of business.""
JArray list = o.Value<JArray>("Drives");
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
""DVD read/writer"",
""500 gigabyte hard drive""
]", list.ToString());
@@ -379,7 +379,7 @@ keyword such as type of business.""
Assert.AreEqual(@"""CPU"": ""Intel""", cpuProperty.ToString());
JProperty drivesProperty = o.Property("Drives");
Assert.AreEqual(@"""Drives"": [
StringAssert.AreEqual(@"""Drives"": [
""DVD read/writer"",
""500 gigabyte hard drive""
]", drivesProperty.ToString());
@@ -392,10 +392,10 @@ keyword such as type of business.""
JObject o = JObject.Parse(json);
Assert.AreEqual(@"""Establised"": new Date(
StringAssert.AreEqual(@"""Establised"": new Date(
1264118400000
)", o.Property("Establised").ToString());
Assert.AreEqual(@"new Date(
StringAssert.AreEqual(@"new Date(
1264118400000
)", o.Property("Establised").Value.ToString());
Assert.AreEqual(@"""Width"": 1.1", o.Property("Width").ToString());
@@ -406,7 +406,7 @@ keyword such as type of business.""
json = @"[null,undefined]";
JArray a = JArray.Parse(json);
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
null,
undefined
]", a.ToString());
@@ -427,7 +427,7 @@ keyword such as type of business.""
Assert.AreEqual(4, o.Properties().Count());
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Test1"": ""Test1Value"",
""Test2"": ""Test2Value"",
""Test3"": ""Test3Value"",
@@ -454,7 +454,7 @@ keyword such as type of business.""
);
Assert.AreEqual(5, a.Count());
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
{
""Test1"": ""Test1Value"",
""Test2"": ""Test2Value"",
@@ -531,7 +531,7 @@ keyword such as type of business.""
// ]
// }
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Title"": ""How to use FromObject - Super effective!"",
""Description"": null,
""Link"": null,
@@ -758,7 +758,7 @@ keyword such as type of business.""
string json = sw.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Test1"": new Date(
971586305000
),
@@ -995,7 +995,7 @@ keyword such as type of business.""
UriGuidTimeSpanTestClass c1 = new UriGuidTimeSpanTestClass();
JObject o = JObject.FromObject(c1);
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Guid"": ""00000000-0000-0000-0000-000000000000"",
""NullableGuid"": null,
""TimeSpan"": ""00:00:00"",
@@ -1024,7 +1024,7 @@ keyword such as type of business.""
};
JObject o = JObject.FromObject(c1);
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Guid"": ""1924129c-f7e0-40f3-9607-9939c531395a"",
""NullableGuid"": ""9e9f3adf-e017-4f72-91e0-617ebe85967d"",
""TimeSpan"": ""1.00:00:00"",
+11 -11
View File
@@ -30,7 +30,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Property1"": 1,
""Property2"": 2
}", json);
@@ -52,7 +52,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Property1"": {
""SubProperty1"": 1,
""SubProperty2"": 2
@@ -77,7 +77,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Property1"": {
""SubProperty1"": 1
}
@@ -101,7 +101,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Property1"": {
""SubProperty1"": 1,
""SubProperty2"": 2
@@ -171,7 +171,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Array1"": [
{
""Property1"": {
@@ -222,7 +222,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Array1"": [
{
""Property1"": 1
@@ -274,7 +274,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
1,
5,
{
@@ -326,7 +326,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Property1"": {
""Nested"": true
},
@@ -366,7 +366,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Array1"": [
4,
5
@@ -396,7 +396,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
4,
5
]", json);
@@ -430,7 +430,7 @@ namespace Newtonsoft.Json.Tests.Linq
string json = left.ToString();
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""Array1"": [
{
""Property1"": 1