-Replace tests console writes with asserts

This commit is contained in:
James Newton-King
2015-03-22 12:37:12 +13:00
parent a3df7ecd98
commit b9af7f227b
34 changed files with 380 additions and 362 deletions
@@ -57,4 +57,4 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("7.0.0.0")] [assembly: AssemblyVersion("7.0.0.0")]
[assembly: AssemblyFileVersion("7.0.1.18321")] [assembly: AssemblyFileVersion("7.0.1.18322")]
@@ -148,7 +148,6 @@ namespace Newtonsoft.Json.Tests.Bson
writer.WriteEnd(); writer.WriteEnd();
string bson = BytesToHex(ms.ToArray()); string bson = BytesToHex(ms.ToArray());
Console.WriteLine(bson);
Assert.AreEqual("1D-00-00-00-05-30-00-10-00-00-00-04-D7-EE-21-D8-5C-4B-C9-43-8A-C2-69-28-E5-79-B7-05-00", bson); Assert.AreEqual("1D-00-00-00-05-30-00-10-00-00-00-04-D7-EE-21-D8-5C-4B-C9-43-8A-C2-69-28-E5-79-B7-05-00", bson);
} }
@@ -290,15 +289,6 @@ namespace Newtonsoft.Json.Tests.Bson
serializer.Serialize(writer1, s1); serializer.Serialize(writer1, s1);
CollectionAssert.AreEquivalent(ms.ToArray(), ms1.ToArray()); CollectionAssert.AreEquivalent(ms.ToArray(), ms1.ToArray());
string s = JsonConvert.SerializeObject(s1);
byte[] textData = Encoding.UTF8.GetBytes(s);
int l1 = textData.Length;
int l2 = ms.ToArray().Length;
Console.WriteLine(l1);
Console.WriteLine(l2);
} }
[Test] [Test]
@@ -740,10 +730,9 @@ namespace Newtonsoft.Json.Tests.Bson
JObject o = (JObject)JObject.ReadFrom(new BsonReader(new MemoryStream(ms.ToArray()))); JObject o = (JObject)JObject.ReadFrom(new BsonReader(new MemoryStream(ms.ToArray())));
Console.WriteLine(o.ToString()); Assert.AreEqual(@"{
//{ ""Regex"": ""/(hi)/iux""
// "Regex": "/(hi)/iux" }", o.ToString());
//}
} }
[Test] [Test]
@@ -111,16 +111,13 @@ namespace Newtonsoft.Json.Tests.Converters
IPerson person = people[0]; IPerson person = people[0];
Console.WriteLine(person.GetType()); Assert.AreEqual("Newtonsoft.Json.Tests.Employee", person.GetType().Name);
// Newtonsoft.Json.Tests.Employee
Console.WriteLine(person.FirstName); Assert.AreEqual("Maurice", person.FirstName);
// Maurice
Employee employee = (Employee)person; Employee employee = (Employee)person;
Console.WriteLine(employee.JobTitle); Assert.AreEqual("Support", employee.JobTitle);
// Support
} }
public class MyClass public class MyClass
@@ -109,7 +109,6 @@ namespace Newtonsoft.Json.Tests.Converters
ts.Stop(); ts.Stop();
Console.WriteLine(ts.Elapsed.TotalSeconds); Console.WriteLine(ts.Elapsed.TotalSeconds);
Console.WriteLine(json);
} }
[Test] [Test]
@@ -136,7 +135,6 @@ namespace Newtonsoft.Json.Tests.Converters
ts.Stop(); ts.Stop();
Console.WriteLine(ts.Elapsed.TotalSeconds); Console.WriteLine(ts.Elapsed.TotalSeconds);
Console.WriteLine(json);
} }
[Test] [Test]
@@ -224,10 +222,8 @@ namespace Newtonsoft.Json.Tests.Converters
object[] fields = caseInfo.FieldReader.Invoke(value); object[] fields = caseInfo.FieldReader.Invoke(value);
foreach (object field in fields) Assert.AreEqual(10, fields[0]);
{ Assert.AreEqual(5, fields[1]);
Console.WriteLine(field);
}
} }
[Test] [Test]
@@ -242,10 +238,9 @@ namespace Newtonsoft.Json.Tests.Converters
10.0, 5.0 10.0, 5.0
}); });
Console.WriteLine(value.ToString()); Assert.AreEqual("Newtonsoft.Json.Tests.TestObjects.Shape+Rectangle", value.ToString());
Assert.AreEqual(10, value.width);
Console.WriteLine(value.width); Assert.AreEqual(5, value.length);
Console.WriteLine(value.length);
} }
[Test] [Test]
@@ -293,8 +288,6 @@ namespace Newtonsoft.Json.Tests.Converters
TypeNameHandling = TypeNameHandling.All TypeNameHandling = TypeNameHandling.All
}); });
Console.WriteLine(json);
Assert.AreEqual(@"{""Case"":""Rectangle"",""Fields"":[10.0,5.0]}", json); Assert.AreEqual(@"{""Case"":""Rectangle"",""Fields"":[10.0,5.0]}", json);
Shape c = JsonConvert.DeserializeObject<Shape>(json); Shape c = JsonConvert.DeserializeObject<Shape>(json);
@@ -275,7 +275,7 @@ namespace Newtonsoft.Json.Tests.Converters
// "LastModified": "2009-04-12T20:44:55" // "LastModified": "2009-04-12T20:44:55"
// } // }
Console.WriteLine(jsonText); Assert.AreEqual(@"{""Name"":""Keith"",""BirthDate"":""1980-03-08T00:00:00"",""LastModified"":""2009-04-12T20:44:55""}", jsonText);
} }
#if !NET20 #if !NET20
@@ -70,13 +70,6 @@ namespace Newtonsoft.Json.Tests.Converters
Assert.AreEqual("new Date(976918263055)", result); Assert.AreEqual("new Date(976918263055)", result);
} }
[Test]
public void sdfs()
{
int i = Convert.ToInt32("+1");
Console.WriteLine(i);
}
[Test] [Test]
public void SerializeNullableDateTimeClass() public void SerializeNullableDateTimeClass()
{ {
@@ -491,15 +491,11 @@ namespace Newtonsoft.Json.Tests.Converters
Value2 = DuplicateNameEnum2.foo_bar_NOT_USED Value2 = DuplicateNameEnum2.foo_bar_NOT_USED
}); });
Console.WriteLine(Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length));
string xml = @"<DuplicateEnumNameTestClass xmlns=""http://schemas.datacontract.org/2004/07/Newtonsoft.Json.Tests.Converters"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""> string xml = @"<DuplicateEnumNameTestClass xmlns=""http://schemas.datacontract.org/2004/07/Newtonsoft.Json.Tests.Converters"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"">
<Value>foo_bar</Value> <Value>foo_bar</Value>
<Value2>foo_bar</Value2> <Value2>foo_bar</Value2>
</DuplicateEnumNameTestClass>"; </DuplicateEnumNameTestClass>";
Console.WriteLine(xml);
var o = (DuplicateEnumNameTestClass)s.ReadObject(new MemoryStream(Encoding.UTF8.GetBytes(xml))); var o = (DuplicateEnumNameTestClass)s.ReadObject(new MemoryStream(Encoding.UTF8.GetBytes(xml)));
Assert.AreEqual(DuplicateNameEnum.foo_bar, o.Value); Assert.AreEqual(DuplicateNameEnum.foo_bar, o.Value);
@@ -151,12 +151,21 @@ namespace Newtonsoft.Json.Tests.Converters
string json = JsonConvert.SerializeObject(d, Formatting.Indented); string json = JsonConvert.SerializeObject(d, Formatting.Indented);
Console.WriteLine(json); Assert.AreEqual(@"{
""result"": {
""@xp_0:end"": ""2014-08-15 13:12:11.9184"",
""@xp_0:start"": ""2014-08-15 13:11:49.3140"",
""@xp_0:time_diff"": ""22604.3836"",
""@xmlns:xp_0"": ""Test1"",
""@p2:end"": ""2014-08-15 13:13:49.5522"",
""@p2:start"": ""2014-08-15 13:13:49.0268"",
""@p2:time_diff"": ""525.4646"",
""@xmlns:p2"": ""Test2""
}
}", json);
XDocument doc = JsonConvert.DeserializeObject<XDocument>(json); XDocument doc = JsonConvert.DeserializeObject<XDocument>(json);
Console.WriteLine(doc.ToString());
Assert.AreEqual(xml, doc.ToString()); Assert.AreEqual(xml, doc.ToString());
} }
#endif #endif
@@ -171,12 +180,21 @@ namespace Newtonsoft.Json.Tests.Converters
string json = JsonConvert.SerializeObject(d, Formatting.Indented); string json = JsonConvert.SerializeObject(d, Formatting.Indented);
Console.WriteLine(json); Assert.AreEqual(@"{
""result"": {
""@xp_0:end"": ""2014-08-15 13:12:11.9184"",
""@xp_0:start"": ""2014-08-15 13:11:49.3140"",
""@xp_0:time_diff"": ""22604.3836"",
""@xmlns:xp_0"": ""Test1"",
""@p2:end"": ""2014-08-15 13:13:49.5522"",
""@p2:start"": ""2014-08-15 13:13:49.0268"",
""@p2:time_diff"": ""525.4646"",
""@xmlns:p2"": ""Test2""
}
}", json);
XmlDocument doc = JsonConvert.DeserializeObject<XmlDocument>(json); XmlDocument doc = JsonConvert.DeserializeObject<XmlDocument>(json);
Console.WriteLine(doc.OuterXml);
Assert.AreEqual(xml, doc.OuterXml); Assert.AreEqual(xml, doc.OuterXml);
} }
@@ -378,7 +396,7 @@ namespace Newtonsoft.Json.Tests.Converters
{ {
XmlDocument doc = JsonConvert.DeserializeXmlNode("{ A: { '@xsi:nil': true } }"); XmlDocument doc = JsonConvert.DeserializeXmlNode("{ A: { '@xsi:nil': true } }");
Console.WriteLine(doc.OuterXml); Assert.AreEqual(@"<A nil=""true"" />", doc.OuterXml);
XDocument xdoc = JsonConvert.DeserializeXNode("{ A: { '@xsi:nil': true } }"); XDocument xdoc = JsonConvert.DeserializeXNode("{ A: { '@xsi:nil': true } }");
@@ -468,10 +486,6 @@ namespace Newtonsoft.Json.Tests.Converters
}"; }";
StringAssert.AreEqual(expected, jsonText); StringAssert.AreEqual(expected, jsonText);
Console.WriteLine("DocumentSerializeIndented");
Console.WriteLine(jsonText);
Console.WriteLine();
} }
[Test] [Test]
@@ -480,8 +494,6 @@ namespace Newtonsoft.Json.Tests.Converters
XmlDocument doc = new XmlDocument(); XmlDocument doc = new XmlDocument();
string jsonText; string jsonText;
Console.WriteLine("SerializeNodeTypes");
string xml = @"<?xml version=""1.0"" encoding=""utf-8"" ?> string xml = @"<?xml version=""1.0"" encoding=""utf-8"" ?>
<xs:schema xs:id=""SomeID"" <xs:schema xs:id=""SomeID""
xmlns="""" xmlns=""""
@@ -500,7 +512,6 @@ namespace Newtonsoft.Json.Tests.Converters
jsonText = JsonConvert.SerializeXmlNode(attribute); jsonText = JsonConvert.SerializeXmlNode(attribute);
Console.WriteLine(jsonText);
Assert.AreEqual(@"{""@msdata:IsDataSet"":""true""}", jsonText); Assert.AreEqual(@"{""@msdata:IsDataSet"":""true""}", jsonText);
#if !NET20 #if !NET20
@@ -517,7 +528,6 @@ namespace Newtonsoft.Json.Tests.Converters
jsonText = JsonConvert.SerializeXmlNode(instruction); jsonText = JsonConvert.SerializeXmlNode(instruction);
Console.WriteLine(jsonText);
Assert.AreEqual(@"{""?xml-stylesheet"":""href=\""classic.xsl\"" type=\""text/xml\""""}", jsonText); Assert.AreEqual(@"{""?xml-stylesheet"":""href=\""classic.xsl\"" type=\""text/xml\""""}", jsonText);
@@ -526,7 +536,6 @@ namespace Newtonsoft.Json.Tests.Converters
jsonText = JsonConvert.SerializeXmlNode(cDataSection); jsonText = JsonConvert.SerializeXmlNode(cDataSection);
Console.WriteLine(jsonText);
Assert.AreEqual(@"{""#cdata-section"":""<Kiwi>true</Kiwi>""}", jsonText); Assert.AreEqual(@"{""#cdata-section"":""<Kiwi>true</Kiwi>""}", jsonText);
@@ -574,10 +583,6 @@ namespace Newtonsoft.Json.Tests.Converters
string expected = @"{""Item"":[""widget"",""widget""]}"; string expected = @"{""Item"":[""widget"",""widget""]}";
Assert.AreEqual(expected, jsonText); Assert.AreEqual(expected, jsonText);
Console.WriteLine("DocumentFragmentSerialize");
Console.WriteLine(jsonText);
Console.WriteLine();
} }
[Test] [Test]
@@ -794,11 +799,6 @@ namespace Newtonsoft.Json.Tests.Converters
XmlDocument deserializedDoc = (XmlDocument)DeserializeXmlNode(jsonText); XmlDocument deserializedDoc = (XmlDocument)DeserializeXmlNode(jsonText);
Assert.AreEqual(doc.InnerXml, deserializedDoc.InnerXml); Assert.AreEqual(doc.InnerXml, deserializedDoc.InnerXml);
Console.WriteLine("NamespaceSerializeDeserialize");
Console.WriteLine(jsonText);
Console.WriteLine(deserializedDoc.InnerXml);
Console.WriteLine();
} }
[Test] [Test]
@@ -834,10 +834,6 @@ namespace Newtonsoft.Json.Tests.Converters
string formattedXml = GetIndentedInnerXml(doc); string formattedXml = GetIndentedInnerXml(doc);
Console.WriteLine("DocumentDeserialize");
Console.WriteLine(formattedXml);
Console.WriteLine();
StringAssert.AreEqual(expected, formattedXml); StringAssert.AreEqual(expected, formattedXml);
} }
@@ -901,7 +897,26 @@ namespace Newtonsoft.Json.Tests.Converters
string jsonText = SerializeXmlNode(doc); string jsonText = SerializeXmlNode(doc);
Console.WriteLine(jsonText); Assert.AreEqual(@"{
""?xml"": {
""@version"": ""1.0"",
""@standalone"": ""no""
},
""root"": {
""person"": [
{
""@id"": ""1"",
""name"": ""Alan"",
""url"": null
},
{
""@id"": ""2"",
""name"": ""Louis"",
""url"": ""http://www.yahoo.com""
}
]
}
}", jsonText);
XmlDocument newDoc = (XmlDocument)DeserializeXmlNode(jsonText); XmlDocument newDoc = (XmlDocument)DeserializeXmlNode(jsonText);
@@ -1171,8 +1186,6 @@ namespace Newtonsoft.Json.Tests.Converters
#if !NET20 #if !NET20
XDocument newXDoc = JsonConvert.DeserializeXNode(json, "myRoot", true); XDocument newXDoc = JsonConvert.DeserializeXNode(json, "myRoot", true);
Console.WriteLine(IndentXml(newXDoc.ToString(SaveOptions.DisableFormatting)));
StringAssert.AreEqual(@"<myRoot> StringAssert.AreEqual(@"<myRoot>
<available_sizes json:Array=""true"" xmlns:json=""http://james.newtonking.com/projects/json""> <available_sizes json:Array=""true"" xmlns:json=""http://james.newtonking.com/projects/json"">
<available_sizes>assets/images/resized/0001/1070/11070v1-max-150x150.jpg</available_sizes> <available_sizes>assets/images/resized/0001/1070/11070v1-max-150x150.jpg</available_sizes>
+59 -8
View File
@@ -92,7 +92,7 @@ namespace Newtonsoft.Json.Tests
Assert.AreEqual(0, r2.Green); Assert.AreEqual(0, r2.Green);
Assert.AreEqual(0, r2.Blue); Assert.AreEqual(0, r2.Blue);
Console.WriteLine(json); Assert.AreEqual(@"""#FF0000""", json);
} }
public class PersonDemo public class PersonDemo
@@ -206,13 +206,11 @@ namespace Newtonsoft.Json.Tests
string trace = traceWriter.ToString(); string trace = traceWriter.ToString();
// Started serializing System.Collections.Generic.List`1[System.String]. // Started serializing System.Collections.Generic.List`1[System.String].
// Finished serializing System.Collections.Generic.List`1[System.String]. // Finished serializing System.Collections.Generic.List`1[System.String].
// 2014-05-13T13:41:53.706 Verbose Serialized JSON: // Verbose Serialized JSON:
// [ // [
// "User", // "User",
// "Admin" // "Admin"
// ] // ]
Console.WriteLine(trace);
} }
[Test] [Test]
@@ -234,7 +232,12 @@ namespace Newtonsoft.Json.Tests
// "Date": new Date(1401796800000) // "Date": new Date(1401796800000)
// } // }
Console.WriteLine(j); Assert.AreEqual(@"{
""Name"": ""Serialize All The Things"",
""Date"": new Date(
1401796800000
)
}", j);
} }
[Test] [Test]
@@ -251,6 +254,8 @@ namespace Newtonsoft.Json.Tests
}); });
// Name = Serialize All The Things // Name = Serialize All The Things
// Date = Tuesday, 3 June 2014 // Date = Tuesday, 3 June 2014
Assert.AreEqual("Serialize All The Things", s.Name);
} }
[Test] [Test]
@@ -311,7 +316,23 @@ namespace Newtonsoft.Json.Tests
// ], // ],
// "Name": "Mike Manager" // "Name": "Mike Manager"
// } // }
Console.WriteLine(json);
Assert.AreEqual(@"{
""Reportees"": [
{
""Name"": ""Arnie Admin""
},
{
""Reportees"": [
{
""Name"": ""Arnie Admin""
}
],
""Name"": ""Susan Supervisor""
}
],
""Name"": ""Mike Manager""
}", json);
} }
[Test] [Test]
@@ -352,7 +373,29 @@ namespace Newtonsoft.Json.Tests
// } // }
// ] // ]
// } // }
Console.WriteLine(json);
Assert.AreEqual(@"{
""$id"": ""1"",
""$type"": ""Newtonsoft.Json.Tests.DemoTests+Manager, Newtonsoft.Json.Tests"",
""Reportees"": [
{
""$id"": ""2"",
""$type"": ""Newtonsoft.Json.Tests.DemoTests+Employee, Newtonsoft.Json.Tests"",
""Name"": ""Arnie Admin""
},
{
""$id"": ""3"",
""$type"": ""Newtonsoft.Json.Tests.DemoTests+Manager, Newtonsoft.Json.Tests"",
""Reportees"": [
{
""$ref"": ""2""
}
],
""Name"": ""Susan Supervisor""
}
],
""Name"": ""Mike Manager""
}", json);
} }
[Test] [Test]
@@ -527,7 +570,15 @@ namespace Newtonsoft.Json.Tests
// ] // ]
// } // }
Console.WriteLine(json); Assert.AreEqual(@"{
""FirstName"": ""John"",
""LastName"": ""Smith"",
""Enabled"": true,
""Roles"": [
""User"",
""Admin""
]
}", json);
} }
} }
} }
@@ -68,7 +68,6 @@ namespace Newtonsoft.Json.Tests.Documentation
public static void WriteAllText(string path, string contents) public static void WriteAllText(string path, string contents)
{ {
Console.WriteLine(contents);
} }
public static string ReadAllText(string path) public static string ReadAllText(string path)
+1 -10
View File
@@ -1081,8 +1081,6 @@ namespace Newtonsoft.Json.Tests
settings.DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind; settings.DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;
var json = JsonConvert.SerializeObject(dict, settings); var json = JsonConvert.SerializeObject(dict, settings);
Console.WriteLine(json);
var newDict = new Dictionary<string, object>(); var newDict = new Dictionary<string, object>();
JsonConvert.PopulateObject(json, newDict, settings); JsonConvert.PopulateObject(json, newDict, settings);
@@ -1103,8 +1101,7 @@ namespace Newtonsoft.Json.Tests
writer.WriteValue(dt); writer.WriteValue(dt);
writer.Flush(); writer.Flush();
Console.WriteLine(sw.ToString()); Assert.AreEqual(@"""2000-12-31T20:59:59.9999999+11:33""", sw.ToString());
Console.WriteLine(sw.ToString().Length);
} }
#endif #endif
@@ -1119,9 +1116,6 @@ namespace Newtonsoft.Json.Tests
writer.WriteValue(dt); writer.WriteValue(dt);
writer.Flush(); writer.Flush();
Console.WriteLine(sw.ToString());
Console.WriteLine(sw.ToString().Length);
} }
[Test] [Test]
@@ -1135,9 +1129,6 @@ namespace Newtonsoft.Json.Tests
writer.WriteValue(dt); writer.WriteValue(dt);
writer.Flush(); writer.Flush();
Console.WriteLine(sw.ToString());
Console.WriteLine(sw.ToString().Length);
} }
@@ -461,7 +461,6 @@ third line", jsonTextReader.Value);
{ {
while (jsonReader.Read()) while (jsonReader.Read())
{ {
Console.WriteLine(jsonReader.Value);
} }
} }
} }
@@ -2848,11 +2847,9 @@ null//comment
double d; double d;
d = Convert.ToDouble("6.0221418e23", CultureInfo.InvariantCulture); d = Convert.ToDouble("6.0221418e23", CultureInfo.InvariantCulture);
Console.WriteLine(d.ToString(new CultureInfo("fr-FR")));
Console.WriteLine(d.ToString("0.#############################################################################"));
//CultureInfo info = CultureInfo.GetCultureInfo("fr-FR"); Assert.AreEqual("6,0221418E+23", d.ToString(new CultureInfo("fr-FR")));
//Console.WriteLine(info.NumberFormat.NumberDecimalSeparator); Assert.AreEqual("602214180000000000000000", d.ToString("0.#############################################################################"));
string json = @"[0e-10,0E-10,0.25e-5,0.3e10,6.0221418e23]"; string json = @"[0e-10,0E-10,0.25e-5,0.3e10,6.0221418e23]";
@@ -161,9 +161,6 @@ namespace Newtonsoft.Json.Tests
string expected = @"[""@"",""\r\n\t\f\b?{\\r\\n\""'"",true,10,10.99,0.99,1E-18,0.000000000000000001,null,null,""This is a string."",null,undefined]"; string expected = @"[""@"",""\r\n\t\f\b?{\\r\\n\""'"",true,10,10.99,0.99,1E-18,0.000000000000000001,null,null,""This is a string."",null,undefined]";
string result = sb.ToString(); string result = sb.ToString();
Console.WriteLine("ValueFormatting");
Console.WriteLine(result);
Assert.AreEqual(expected, result); Assert.AreEqual(expected, result);
} }
@@ -274,9 +271,6 @@ namespace Newtonsoft.Json.Tests
string expected = @"[""\""These pretzels are making me thirsty!\"""",""Jeff's house was burninated."",""1. You don't talk about fight club.\r\n2. You don't talk about fight club."",""35% of\t statistics\n are made\r up.""]"; string expected = @"[""\""These pretzels are making me thirsty!\"""",""Jeff's house was burninated."",""1. You don't talk about fight club.\r\n2. You don't talk about fight club."",""35% of\t statistics\n are made\r up.""]";
string result = sb.ToString(); string result = sb.ToString();
Console.WriteLine("StringEscaping");
Console.WriteLine(result);
Assert.AreEqual(expected, result); Assert.AreEqual(expected, result);
} }
@@ -1145,11 +1139,6 @@ _____'propertyName': NaN,
JsonTextReader reader = new JsonTextReader(new StringReader(json)); JsonTextReader reader = new JsonTextReader(new StringReader(json));
Assert.AreEqual(script, reader.ReadAsString()); Assert.AreEqual(script, reader.ReadAsString());
//Console.WriteLine(HttpUtility.HtmlEncode(script));
//System.Web.Script.Serialization.JavaScriptSerializer s = new System.Web.Script.Serialization.JavaScriptSerializer();
//Console.WriteLine(s.Serialize(new { html = script }));
} }
[Test] [Test]
@@ -1272,15 +1261,10 @@ _____'propertyName': NaN,
[Test] [Test]
public void CompareNewStringEscapingWithOld() public void CompareNewStringEscapingWithOld()
{ {
Console.WriteLine("Started");
char c = (char)0; char c = (char)0;
do do
{ {
if (c % 1000 == 0)
Console.WriteLine("Position: " + (int)c);
StringWriter swNew = new StringWriter(); StringWriter swNew = new StringWriter();
char[] buffer = null; char[] buffer = null;
JavaScriptUtils.WriteEscapedJavaScriptString(swNew, c.ToString(), '"', true, JavaScriptUtils.DoubleQuoteCharEscapeFlags, StringEscapeHandling.Default, ref buffer); JavaScriptUtils.WriteEscapedJavaScriptString(swNew, c.ToString(), '"', true, JavaScriptUtils.DoubleQuoteCharEscapeFlags, StringEscapeHandling.Default, ref buffer);
@@ -1296,8 +1280,6 @@ _____'propertyName': NaN,
c++; c++;
} while (c != char.MaxValue); } while (c != char.MaxValue);
Console.WriteLine("Finished");
} }
private const string EscapedUnicodeText = "!"; private const string EscapedUnicodeText = "!";
@@ -94,11 +94,6 @@ namespace Newtonsoft.Json.Tests.Linq
} }
} }
//foreach (KeyValuePair<string, int> keyValuePair in counts)
//{
// Console.WriteLine(keyValuePair.Key + ": " + keyValuePair.Value);
//}
Console.WriteLine("Time (secs): " + sw.Elapsed.TotalSeconds); Console.WriteLine("Time (secs): " + sw.Elapsed.TotalSeconds);
} }
#endif #endif
+16 -25
View File
@@ -570,8 +570,8 @@ Parameter name: arrayIndex");
string smallest = (string)sizes[0]; string smallest = (string)sizes[0];
// Small // Small
Console.WriteLine(name); Assert.AreEqual("Apple", name);
Console.WriteLine(smallest); Assert.AreEqual("Small", smallest);
} }
[Test] [Test]
@@ -603,12 +603,6 @@ Parameter name: arrayIndex");
} }
}; };
Console.WriteLine(shortie.Original);
// http://www.foo.com/
Console.WriteLine(shortie.Error.ErrorMessage);
// No action taken
Assert.AreEqual("http://www.foo.com/", shortie.Original); Assert.AreEqual("http://www.foo.com/", shortie.Original);
Assert.AreEqual("krehqk", shortie.Short); Assert.AreEqual("krehqk", shortie.Short);
Assert.AreEqual(null, shortie.Shortened); Assert.AreEqual(null, shortie.Shortened);
@@ -641,15 +635,13 @@ Parameter name: arrayIndex");
moss["Department"] = new JValue("IT"); moss["Department"] = new JValue("IT");
moss["JobTitle"] = new JValue("Support"); moss["JobTitle"] = new JValue("Support");
Console.WriteLine(moss.ToString()); Assert.AreEqual(@"{
//{ ""FirstName"": ""Maurice"",
// "FirstName": "Maurice", ""LastName"": ""Moss"",
// "LastName": "Moss", ""BirthDate"": ""1977-12-30T00:00:00"",
// "BirthDate": "\/Date(252241200000+1300)\/", ""Department"": ""IT"",
// "Department": "IT", ""JobTitle"": ""Support""
// "JobTitle": "Support" }", moss.ToString());
//}
JObject jen = new JObject(); JObject jen = new JObject();
jen["FirstName"] = "Jen"; jen["FirstName"] = "Jen";
@@ -658,14 +650,13 @@ Parameter name: arrayIndex");
jen["Department"] = "IT"; jen["Department"] = "IT";
jen["JobTitle"] = "Manager"; jen["JobTitle"] = "Manager";
Console.WriteLine(jen.ToString()); Assert.AreEqual(@"{
//{ ""FirstName"": ""Jen"",
// "FirstName": "Jen", ""LastName"": ""Barber"",
// "LastName": "Barber", ""BirthDate"": ""1978-03-15T00:00:00"",
// "BirthDate": "\/Date(258721200000+1300)\/", ""Department"": ""IT"",
// "Department": "IT", ""JobTitle"": ""Manager""
// "JobTitle": "Manager" }", jen.ToString());
//}
} }
[Test] [Test]
+25 -1
View File
@@ -1109,7 +1109,31 @@ namespace Newtonsoft.Json.Tests.Linq
JArray a2 = (JArray)a.DeepClone(); JArray a2 = (JArray)a.DeepClone();
Console.WriteLine(a2.ToString(Formatting.Indented)); Assert.AreEqual(@"[
5,
[
1
],
[
1,
2
],
[
1,
2,
3
],
{
""First"": ""SGk="",
""Second"": 1,
""Third"": null,
""Fourth"": new Date(
12345
),
""Fifth"": ""Infinity"",
""Sixth"": ""NaN""
}
]", a2.ToString(Formatting.Indented));
Assert.IsTrue(a.DeepEquals(a2)); Assert.IsTrue(a.DeepEquals(a2));
} }
@@ -223,7 +223,7 @@ undefined
JToken v1 = o["frameworks"]["aspnetcore50"]["dependencies"]["System.Xml.ReaderWriter"]["source"]; JToken v1 = o["frameworks"]["aspnetcore50"]["dependencies"]["System.Xml.ReaderWriter"]["source"];
Console.WriteLine(v1.Path); Assert.AreEqual("frameworks.aspnetcore50.dependencies.['System.Xml.ReaderWriter'].source", v1.Path);
JToken v2 = o.SelectToken(v1.Path); JToken v2 = o.SelectToken(v1.Path);
@@ -260,7 +260,9 @@ undefined
foreach (JObject friend in items) foreach (JObject friend in items)
{ {
Console.WriteLine(friend); Assert.AreEqual(@"{
""name"": ""value!""
}", friend.ToString());
} }
} }
@@ -304,8 +306,7 @@ undefined
JsonSerializer serializer = new JsonSerializer(); JsonSerializer serializer = new JsonSerializer();
Person p = (Person)serializer.Deserialize(new JTokenReader(o), typeof(Person)); Person p = (Person)serializer.Deserialize(new JTokenReader(o), typeof(Person));
// John Smith Assert.AreEqual("John Smith", p.Name);
Console.WriteLine(p.Name);
} }
[Test] [Test]
@@ -714,47 +715,40 @@ keyword such as type of business.""
from c in p.Categories from c in p.Categories
select new JValue(c))))))))); select new JValue(c)))))))));
Console.WriteLine(rss.ToString()); Assert.AreEqual(@"{
""channel"": {
//{ ""title"": ""James Newton-King"",
// "channel": { ""link"": ""http://james.newtonking.com"",
// "title": "James Newton-King", ""description"": ""James Newton-King's blog."",
// "link": "http://james.newtonking.com", ""item"": [
// "description": "James Newton-King's blog.", {
// "item": [ ""title"": ""Json.NET 1.3 + New license + Now on CodePlex"",
// { ""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex"",
// "title": "Json.NET 1.3 + New license + Now on CodePlex", ""link"": ""http://james.newtonking.com/projects/json-net.aspx"",
// "description": "Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex", ""category"": [
// "link": "http://james.newtonking.com/projects/json-net.aspx", ""Json.NET"",
// "category": [ ""CodePlex""
// "Json.NET", ]
// "CodePlex" },
// ] {
// }, ""title"": ""LINQ to JSON beta"",
// { ""description"": ""Annoucing LINQ to JSON"",
// "title": "LINQ to JSON beta", ""link"": ""http://james.newtonking.com/projects/json-net.aspx"",
// "description": "Annoucing LINQ to JSON", ""category"": [
// "link": "http://james.newtonking.com/projects/json-net.aspx", ""Json.NET"",
// "category": [ ""LINQ""
// "Json.NET", ]
// "LINQ" }
// ] ]
// } }
// ] }", rss.ToString());
// }
//}
var postTitles = var postTitles =
from p in rss["channel"]["item"] from p in rss["channel"]["item"]
select p.Value<string>("title"); select p.Value<string>("title");
foreach (var item in postTitles) Assert.AreEqual("Json.NET 1.3 + New license + Now on CodePlex", postTitles.ElementAt(0));
{ Assert.AreEqual("LINQ to JSON beta", postTitles.ElementAt(1));
Console.WriteLine(item);
}
//LINQ to JSON beta
//Json.NET 1.3 + New license + Now on CodePlex
var categories = var categories =
from c in rss["channel"]["item"].Children()["category"].Values<string>() from c in rss["channel"]["item"].Children()["category"].Values<string>()
@@ -763,14 +757,12 @@ keyword such as type of business.""
orderby g.Count() descending orderby g.Count() descending
select new { Category = g.Key, Count = g.Count() }; select new { Category = g.Key, Count = g.Count() };
foreach (var c in categories) Assert.AreEqual("Json.NET", categories.ElementAt(0).Category);
{ Assert.AreEqual(2, categories.ElementAt(0).Count);
Console.WriteLine(c.Category + " - Count: " + c.Count); Assert.AreEqual("CodePlex", categories.ElementAt(1).Category);
} Assert.AreEqual(1, categories.ElementAt(1).Count);
Assert.AreEqual("LINQ", categories.ElementAt(2).Category);
//Json.NET - Count: 2 Assert.AreEqual(1, categories.ElementAt(2).Count);
//LINQ - Count: 1
//CodePlex - Count: 1
} }
[Test] [Test]
@@ -930,7 +922,34 @@ keyword such as type of business.""
} }
}); });
Console.WriteLine(o.ToString()); Assert.AreEqual(@"{
""channel"": {
""title"": ""James Newton-King"",
""link"": ""http://james.newtonking.com"",
""description"": ""James Newton-King's blog."",
""item"": [
{
""title"": ""Json.NET 1.3 + New license + Now on CodePlex"",
""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex"",
""link"": ""http://james.newtonking.com/projects/json-net.aspx"",
""category"": [
""Json.NET"",
""CodePlex""
]
},
{
""title"": ""LINQ to JSON beta"",
""description"": ""Annoucing LINQ to JSON"",
""link"": ""http://james.newtonking.com/projects/json-net.aspx"",
""category"": [
""Json.NET"",
""LINQ""
]
}
]
}
}", o.ToString());
CustomAssert.IsInstanceOfType(typeof(JObject), o); CustomAssert.IsInstanceOfType(typeof(JObject), o);
CustomAssert.IsInstanceOfType(typeof(JObject), o["channel"]); CustomAssert.IsInstanceOfType(typeof(JObject), o["channel"]);
Assert.AreEqual("James Newton-King", (string)o["channel"]["title"]); Assert.AreEqual("James Newton-King", (string)o["channel"]["title"]);
@@ -968,7 +987,34 @@ keyword such as type of business.""
} }
}); });
Console.WriteLine(o.ToString()); Assert.AreEqual(@"{
""channel"": {
""title"": ""James Newton-King"",
""link"": ""http://james.newtonking.com"",
""description"": ""James Newton-King's blog."",
""item"": [
{
""title"": ""Json.NET 1.3 + New license + Now on CodePlex"",
""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex"",
""link"": ""http://james.newtonking.com/projects/json-net.aspx"",
""category"": [
""Json.NET"",
""CodePlex""
]
},
{
""title"": ""LINQ to JSON beta"",
""description"": ""Annoucing LINQ to JSON"",
""link"": ""http://james.newtonking.com/projects/json-net.aspx"",
""category"": [
""Json.NET"",
""LINQ""
]
}
]
}
}", o.ToString());
CustomAssert.IsInstanceOfType(typeof(JObject), o); CustomAssert.IsInstanceOfType(typeof(JObject), o);
CustomAssert.IsInstanceOfType(typeof(JObject), o["channel"]); CustomAssert.IsInstanceOfType(typeof(JObject), o["channel"]);
Assert.AreEqual("James Newton-King", (string)o["channel"]["title"]); Assert.AreEqual("James Newton-King", (string)o["channel"]["title"]);
@@ -76,4 +76,4 @@ using System.Security;
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("7.0.0.0")] [assembly: AssemblyVersion("7.0.0.0")]
[assembly: AssemblyFileVersion("7.0.1.18321")] [assembly: AssemblyFileVersion("7.0.1.18322")]
@@ -59,18 +59,13 @@ namespace Newtonsoft.Json.Tests.Schema
[TestCaseSourceAttribute("GetSpecTestDetails")] [TestCaseSourceAttribute("GetSpecTestDetails")]
public void SpecTest(JsonSchemaSpecTest jsonSchemaSpecTest) public void SpecTest(JsonSchemaSpecTest jsonSchemaSpecTest)
{ {
//if (jsonSchemaSpecTest.ToString() == "enum.json - simple enum validation - something else is invalid") JsonSchema s = JsonSchema.Read(jsonSchemaSpecTest.Schema.CreateReader());
{
Console.WriteLine("Running JSON Schema test " + jsonSchemaSpecTest.TestNumber + ": " + jsonSchemaSpecTest);
JsonSchema s = JsonSchema.Read(jsonSchemaSpecTest.Schema.CreateReader()); IList<string> errorMessages;
bool v = jsonSchemaSpecTest.Data.IsValid(s, out errorMessages);
errorMessages = errorMessages ?? new List<string>();
IList<string> errorMessages; Assert.AreEqual(jsonSchemaSpecTest.IsValid, v, jsonSchemaSpecTest.TestCaseDescription + " - " + jsonSchemaSpecTest.TestDescription + " - errors: " + string.Join(", ", errorMessages));
bool v = jsonSchemaSpecTest.Data.IsValid(s, out errorMessages);
errorMessages = errorMessages ?? new List<string>();
Assert.AreEqual(jsonSchemaSpecTest.IsValid, v, jsonSchemaSpecTest.TestCaseDescription + " - " + jsonSchemaSpecTest.TestDescription + " - errors: " + string.Join(", ", errorMessages));
}
} }
public IList<JsonSchemaSpecTest> GetSpecTestDetails() public IList<JsonSchemaSpecTest> GetSpecTestDetails()
@@ -373,7 +373,7 @@ namespace Newtonsoft.Json.Tests.Serialization
public void PopulateTest() public void PopulateTest()
{ {
var test = JsonConvert.DeserializeObject<PopulateWithNullJsonTest>("{\"IntValue\":null}"); var test = JsonConvert.DeserializeObject<PopulateWithNullJsonTest>("{\"IntValue\":null}");
Console.WriteLine("IntValue:{0}", test.IntValue); Assert.AreEqual(0, test.IntValue);
} }
public class PopulateWithNullJsonTest public class PopulateWithNullJsonTest
@@ -123,7 +123,16 @@ namespace Newtonsoft.Json.Tests.Serialization
TypeNameAssemblyFormat = FormatterAssemblyStyle.Full TypeNameAssemblyFormat = FormatterAssemblyStyle.Full
}); });
Console.WriteLine(json); Assert.AreEqual(@"{
""$type"": ""System.Dynamic.ExpandoObject, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"",
""Text"": ""Text!"",
""Integer"": 2147483647,
""DynamicChildObject"": {
""$type"": ""Newtonsoft.Json.Tests.Serialization.DynamicChildObject, Newtonsoft.Json.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null"",
""Text"": ""Child text!"",
""Integer"": -2147483648
}
}", json);
string dynamicChildObjectTypeName = ReflectionUtils.GetTypeName(typeof(DynamicChildObject), FormatterAssemblyStyle.Full, null); string dynamicChildObjectTypeName = ReflectionUtils.GetTypeName(typeof(DynamicChildObject), FormatterAssemblyStyle.Full, null);
string expandoObjectTypeName = ReflectionUtils.GetTypeName(typeof(ExpandoObject), FormatterAssemblyStyle.Full, null); string expandoObjectTypeName = ReflectionUtils.GetTypeName(typeof(ExpandoObject), FormatterAssemblyStyle.Full, null);
@@ -268,8 +277,6 @@ namespace Newtonsoft.Json.Tests.Serialization
NullValueHandling = NullValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore,
}); });
Console.WriteLine(json);
StringAssert.AreEqual(@"{ StringAssert.AreEqual(@"{
""Explicit"": false, ""Explicit"": false,
""Text"": ""Text!"", ""Text"": ""Text!"",
@@ -291,8 +298,6 @@ namespace Newtonsoft.Json.Tests.Serialization
NullValueHandling = NullValueHandling.Include, NullValueHandling = NullValueHandling.Include,
}); });
Console.WriteLine(json);
StringAssert.AreEqual(@"{ StringAssert.AreEqual(@"{
""Explicit"": false, ""Explicit"": false,
""Text"": ""Text!"", ""Text"": ""Text!"",
@@ -318,8 +323,6 @@ namespace Newtonsoft.Json.Tests.Serialization
DefaultValueHandling = DefaultValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore,
}); });
Console.WriteLine(json);
StringAssert.AreEqual(@"{ StringAssert.AreEqual(@"{
""Text"": ""Text!"", ""Text"": ""Text!"",
""Int"": 2147483647 ""Int"": 2147483647
@@ -150,7 +150,13 @@ namespace Newtonsoft.Json.Tests.Serialization
string json = JsonConvert.SerializeObject(e, Formatting.Indented); string json = JsonConvert.SerializeObject(e, Formatting.Indented);
Console.WriteLine(json); Assert.AreEqual(@"{
""extensionData1"": [
1,
2,
3
]
}", json);
Example e2 = JsonConvert.DeserializeObject<Example>(json); Example e2 = JsonConvert.DeserializeObject<Example>(json);
@@ -66,9 +66,6 @@ namespace Newtonsoft.Json.Tests.Serialization
""II"", ""II"",
""3"" ""3""
]", json); ]", json);
Console.WriteLine("Serialized immutable list:");
Console.WriteLine(json);
} }
[Test] [Test]
@@ -100,17 +97,10 @@ namespace Newtonsoft.Json.Tests.Serialization
// what sorcery is this?! // what sorcery is this?!
IImmutableList<string> champions = JsonConvert.DeserializeObject<IImmutableList<string>>(json); IImmutableList<string> champions = JsonConvert.DeserializeObject<IImmutableList<string>>(json);
Console.WriteLine(champions[0]);
// Volibear
Assert.AreEqual(3, champions.Count); Assert.AreEqual(3, champions.Count);
Assert.AreEqual("Volibear", champions[0]); Assert.AreEqual("Volibear", champions[0]);
Assert.AreEqual("Teemo", champions[1]); Assert.AreEqual("Teemo", champions[1]);
Assert.AreEqual("Katarina", champions[2]); Assert.AreEqual("Katarina", champions[2]);
Console.WriteLine("Deserialized immutable list:");
Console.WriteLine(string.Join(", ", champions));
} }
#endregion #endregion
@@ -1522,16 +1522,10 @@ namespace Newtonsoft.Json.Tests.Serialization
List<Product> products = JsonConvert.DeserializeObject<List<Product>>(json); List<Product> products = JsonConvert.DeserializeObject<List<Product>>(json);
Console.WriteLine(products.Count);
// 2
Product p1 = products[0]; Product p1 = products[0];
Console.WriteLine(p1.Name);
// Product 1
Assert.AreEqual(2, products.Count); Assert.AreEqual(2, products.Count);
Assert.AreEqual("Product 1", products[0].Name); Assert.AreEqual("Product 1", p1.Name);
} }
#if !(NET40 || NET35 || NET20 || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
@@ -229,8 +229,6 @@ namespace Newtonsoft.Json.Tests.Serialization
string json = JsonConvert.SerializeObject(c, Formatting.Indented); string json = JsonConvert.SerializeObject(c, Formatting.Indented);
Console.WriteLine(json);
StringAssert.AreEqual(@"{ StringAssert.AreEqual(@"{
""FaqId"": 1, ""FaqId"": 1,
""Name"": null, ""Name"": null,
@@ -256,8 +254,6 @@ namespace Newtonsoft.Json.Tests.Serialization
string json = JsonConvert.SerializeObject(c, Formatting.Indented); string json = JsonConvert.SerializeObject(c, Formatting.Indented);
Console.WriteLine(json);
StringAssert.AreEqual(@"{ StringAssert.AreEqual(@"{
""IsProxy"": true, ""IsProxy"": true,
""FaqId"": 1, ""FaqId"": 1,
@@ -1117,8 +1113,6 @@ namespace Newtonsoft.Json.Tests.Serialization
var stopWatch = Stopwatch.StartNew(); var stopWatch = Stopwatch.StartNew();
var deserialize = jsonSerializer.Deserialize(new StreamReader(ms), typeof(Dictionary<DictionaryKeyCast, int>)); var deserialize = jsonSerializer.Deserialize(new StreamReader(ms), typeof(Dictionary<DictionaryKeyCast, int>));
stopWatch.Stop(); stopWatch.Stop();
Console.WriteLine("Time elapsed: " + stopWatch.ElapsedMilliseconds);
} }
#endif #endif
@@ -1308,8 +1302,6 @@ namespace Newtonsoft.Json.Tests.Serialization
string json = JsonConvert.SerializeObject(baseWith, Formatting.Indented); string json = JsonConvert.SerializeObject(baseWith, Formatting.Indented);
Console.WriteLine(json);
StringAssert.AreEqual(@"{ StringAssert.AreEqual(@"{
""VirtualWithDataMemberBase"": ""VirtualWithDataMember2!"", ""VirtualWithDataMemberBase"": ""VirtualWithDataMember2!"",
""VirtualSub"": ""Virtual2!"", ""VirtualSub"": ""Virtual2!"",
@@ -1388,9 +1380,9 @@ namespace Newtonsoft.Json.Tests.Serialization
JObject jsonNetJson = JObject.Parse(JsonConvert.SerializeObject(o)); JObject jsonNetJson = JObject.Parse(JsonConvert.SerializeObject(o));
jsonNetJson = new JObject(jsonNetJson.Properties().OrderBy(p => p.Name)); jsonNetJson = new JObject(jsonNetJson.Properties().OrderBy(p => p.Name));
Console.WriteLine("Results for " + o.GetType().Name); //Console.WriteLine("Results for " + o.GetType().Name);
Console.WriteLine("DataContractJsonSerializer: " + dataContractJson); //Console.WriteLine("DataContractJsonSerializer: " + dataContractJson);
Console.WriteLine("JsonDotNetSerializer : " + jsonNetJson); //Console.WriteLine("JsonDotNetSerializer : " + jsonNetJson);
Assert.AreEqual(dataContractJson.Count, jsonNetJson.Count); Assert.AreEqual(dataContractJson.Count, jsonNetJson.Count);
foreach (KeyValuePair<string, JToken> property in dataContractJson) foreach (KeyValuePair<string, JToken> property in dataContractJson)
@@ -2235,11 +2227,10 @@ keyword such as type of business.""
string json = JsonConvert.SerializeObject(c, Formatting.Indented); string json = JsonConvert.SerializeObject(c, Formatting.Indented);
Console.WriteLine(json); Assert.AreEqual(@"{
//{ ""DefaultConverter"": ""1970-01-01T00:00:00Z"",
// "DefaultConverter": "\/Date(0)\/", ""MemberConverter"": ""1970-01-01T00:00:00Z""
// "MemberConverter": "1970-01-01T00:00:00Z" }", json);
//}
} }
[Test] [Test]
@@ -2454,7 +2445,6 @@ keyword such as type of business.""
}; };
string json = JsonConvert.SerializeObject(requiredMembersClass); string json = JsonConvert.SerializeObject(requiredMembersClass);
Console.WriteLine(json);
}, "Cannot write a null value for property 'FirstName'. Property requires a value. Path ''."); }, "Cannot write a null value for property 'FirstName'. Property requires a value. Path ''.");
} }
@@ -2591,9 +2581,9 @@ keyword such as type of business.""
string javascriptJson = JsonConvert.SerializeObject(entry, new JavaScriptDateTimeConverter()); string javascriptJson = JsonConvert.SerializeObject(entry, new JavaScriptDateTimeConverter());
// {"Details":"Application started.","LogDate":new Date(1234656000000)} // {"Details":"Application started.","LogDate":new Date(1234656000000)}
Console.WriteLine(defaultJson); Assert.AreEqual(@"{""Details"":""Application started."",""LogDate"":""2009-02-15T00:00:00Z""}", defaultJson);
Console.WriteLine(isoJson); Assert.AreEqual(@"{""Details"":""Application started."",""LogDate"":""2009-02-15T00:00:00Z""}", isoJson);
Console.WriteLine(javascriptJson); Assert.AreEqual(@"{""Details"":""Application started."",""LogDate"":new Date(1234656000000)}", javascriptJson);
} }
public void GenericListAndDictionaryInterfaceProperties() public void GenericListAndDictionaryInterfaceProperties()
@@ -3157,12 +3147,6 @@ keyword such as type of business.""
Dictionary<string, string> values = JsonConvert.DeserializeObject<Dictionary<string, string>>(json); Dictionary<string, string> values = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
Console.WriteLine(values.Count);
// 2
Console.WriteLine(values["key1"]);
// value1
Assert.AreEqual(2, values.Count); Assert.AreEqual(2, values.Count);
Assert.AreEqual("value1", values["key1"]); Assert.AreEqual("value1", values["key1"]);
Assert.AreEqual("value2", values["key2"]); Assert.AreEqual("value2", values["key2"]);
@@ -3455,7 +3439,7 @@ Path '', line 1, position 1.");
}; };
string json = JsonConvert.SerializeObject(structTest, Formatting.Indented); string json = JsonConvert.SerializeObject(structTest, Formatting.Indented);
Console.WriteLine(json);
StringAssert.AreEqual(@"{ StringAssert.AreEqual(@"{
""StringField"": ""StringField"", ""StringField"": ""StringField"",
""IntField"": 10, ""IntField"": 10,
@@ -4857,7 +4841,7 @@ Path '', line 1, position 1.");
string json = JsonConvert.SerializeObject(child); string json = JsonConvert.SerializeObject(child);
Console.WriteLine(json); Assert.AreEqual(@"{""_id"":2,""Name"":""Isabell"",""Father"":{""$ref"":null,""$id"":null,""blah"":""blah!""}}", json);
Dictionary<string, object> result = JsonConvert.DeserializeObject<Dictionary<string, object>>(json); Dictionary<string, object> result = JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
@@ -5700,7 +5684,10 @@ Path '', line 1, position 1.");
// ""nonVirtualMember"": ""NonVirtualMember!"" // ""nonVirtualMember"": ""NonVirtualMember!""
//}", result); //}", result);
Console.WriteLine(result); Assert.AreEqual(@"{
""virtualMember"": ""VirtualMember!"",
""nonVirtualMember"": ""NonVirtualMember!""
}", result);
} }
[Test] [Test]
@@ -5719,7 +5706,7 @@ Path '', line 1, position 1.");
string xml = Encoding.UTF8.GetString(ms.ToArray(), 0, Convert.ToInt32(ms.Length)); string xml = Encoding.UTF8.GetString(ms.ToArray(), 0, Convert.ToInt32(ms.Length));
Console.WriteLine(xml); Assert.AreEqual(@"<JsonSerializerTest.ChildDataContract xmlns=""http://schemas.datacontract.org/2004/07/Newtonsoft.Json.Tests.Serialization"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""><nonVirtualMember>NonVirtualMember!</nonVirtualMember><virtualMember>VirtualMember!</virtualMember><NewMember i:nil=""true""/></JsonSerializerTest.ChildDataContract>", xml);
} }
#endif #endif
@@ -5768,7 +5755,6 @@ Path '', line 1, position 1.");
}; };
string result = JsonConvert.SerializeObject(cc); string result = JsonConvert.SerializeObject(cc);
Console.WriteLine(result);
Assert.AreEqual(@"{""differentVirtualMember"":""VirtualMember!"",""nonVirtualMember"":""NonVirtualMember!""}", result); Assert.AreEqual(@"{""differentVirtualMember"":""VirtualMember!"",""nonVirtualMember"":""NonVirtualMember!""}", result);
} }
@@ -6908,8 +6894,11 @@ Path '', line 1, position 1.");
JArray a = (JArray)JArray.ReadFrom(reader); JArray a = (JArray)JArray.ReadFrom(reader);
JValue v = (JValue)a[0]; JValue v = (JValue)a[0];
Console.WriteLine(v.Value.GetType());
Console.WriteLine(a.ToString()); Assert.AreEqual(typeof(string), v.Value.GetType());
Assert.AreEqual(@"[
""2000-01-02T03:04:05+06:00""
]", a.ToString());
} }
[Test] [Test]
@@ -7907,15 +7896,11 @@ Path '', line 1, position 1.");
string expected = JsonConvert.SerializeObject(dates, Formatting.Indented); string expected = JsonConvert.SerializeObject(dates, Formatting.Indented);
Console.WriteLine(expected);
string actual = JsonConvert.SerializeObject(dates, Formatting.Indented, new JsonSerializerSettings string actual = JsonConvert.SerializeObject(dates, Formatting.Indented, new JsonSerializerSettings
{ {
DateFormatString = JsonSerializerSettings.DefaultDateFormatString DateFormatString = JsonSerializerSettings.DefaultDateFormatString
}); });
Console.WriteLine(expected);
Assert.AreEqual(expected, actual); Assert.AreEqual(expected, actual);
} }
#endif #endif
@@ -8202,7 +8187,8 @@ Path '', line 1, position 1.");
ParticipantEntity product = new ParticipantEntity(); ParticipantEntity product = new ParticipantEntity();
product.Properties = new Dictionary<string, string> { { "s", "d" } }; product.Properties = new Dictionary<string, string> { { "s", "d" } };
string json = JsonConvert.SerializeObject(product); string json = JsonConvert.SerializeObject(product);
Console.WriteLine(json);
Assert.AreEqual(@"{""pa_info"":{""s"":""d""}}", json);
ParticipantEntity deserializedProduct = JsonConvert.DeserializeObject<ParticipantEntity>(json); ParticipantEntity deserializedProduct = JsonConvert.DeserializeObject<ParticipantEntity>(json);
} }
@@ -8601,8 +8587,6 @@ Path '', line 1, position 1.");
var serializerSettings = new JsonSerializerSettings(); var serializerSettings = new JsonSerializerSettings();
var jsonCopy = JsonConvert.SerializeObject(original, serializerSettings); var jsonCopy = JsonConvert.SerializeObject(original, serializerSettings);
Console.WriteLine(original);
var clonedObject = JsonConvert.DeserializeObject<DerivedConstructorType>(jsonCopy, serializerSettings); var clonedObject = JsonConvert.DeserializeObject<DerivedConstructorType>(jsonCopy, serializerSettings);
Assert.AreEqual("Base", clonedObject.BaseProperty); Assert.AreEqual("Base", clonedObject.BaseProperty);
@@ -70,8 +70,7 @@ namespace Newtonsoft.Json.Tests.Serialization
User u = (User)o; User u = (User)o;
Console.WriteLine(u.Name); Assert.AreEqual(u.Name, "James");
// James
} }
[Test] [Test]
@@ -119,7 +118,7 @@ namespace Newtonsoft.Json.Tests.Serialization
public void SerializeDeserialize_DictionaryContextContainsGuid_DeserializesItemAsGuid() public void SerializeDeserialize_DictionaryContextContainsGuid_DeserializesItemAsGuid()
{ {
const string contextKey = "k1"; const string contextKey = "k1";
var someValue = Guid.NewGuid(); var someValue = new Guid("5dd2dba0-20c0-49f8-a054-1fa3b0a8d774");
Dictionary<string, Guid> inputContext = new Dictionary<string, Guid>(); Dictionary<string, Guid> inputContext = new Dictionary<string, Guid>();
inputContext.Add(contextKey, someValue); inputContext.Add(contextKey, someValue);
@@ -132,7 +131,10 @@ namespace Newtonsoft.Json.Tests.Serialization
}; };
string serializedString = JsonConvert.SerializeObject(inputContext, jsonSerializerSettings); string serializedString = JsonConvert.SerializeObject(inputContext, jsonSerializerSettings);
Console.WriteLine(serializedString); Assert.AreEqual(@"{
""$type"": ""System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Guid, mscorlib]], mscorlib"",
""k1"": ""5dd2dba0-20c0-49f8-a054-1fa3b0a8d774""
}", serializedString);
var deserializedObject = (Dictionary<string, Guid>)JsonConvert.DeserializeObject(serializedString, jsonSerializerSettings); var deserializedObject = (Dictionary<string, Guid>)JsonConvert.DeserializeObject(serializedString, jsonSerializerSettings);
@@ -257,7 +259,15 @@ namespace Newtonsoft.Json.Tests.Serialization
string json = JsonConvert.SerializeObject(child, Formatting.Indented); string json = JsonConvert.SerializeObject(child, Formatting.Indented);
Console.WriteLine(json); Assert.AreEqual(@"{
""_id"": 2,
""Name"": ""Isabell"",
""Father"": {
""blah"": ""blah!"",
""$ref"": null,
""$id"": null
}
}", json);
Dictionary<string, object> result = JsonConvert.DeserializeObject<Dictionary<string, object>>(json, new JsonSerializerSettings Dictionary<string, object> result = JsonConvert.DeserializeObject<Dictionary<string, object>>(json, new JsonSerializerSettings
{ {
@@ -823,19 +823,16 @@ namespace Newtonsoft.Json.Tests.Serialization
List<Person> deserializedPeople = JsonConvert.DeserializeObject<List<Person>>(json, List<Person> deserializedPeople = JsonConvert.DeserializeObject<List<Person>>(json,
new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects }); new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects });
Console.WriteLine(deserializedPeople.Count); Assert.AreEqual(2, deserializedPeople.Count);
// 2
Person p1 = deserializedPeople[0]; Person p1 = deserializedPeople[0];
Person p2 = deserializedPeople[1]; Person p2 = deserializedPeople[1];
Console.WriteLine(p1.Name); Assert.AreEqual("James", p1.Name);
// James Assert.AreEqual("James", p2.Name);
Console.WriteLine(p2.Name);
// James
bool equal = Object.ReferenceEquals(p1, p2); bool equal = Object.ReferenceEquals(p1, p2);
// true Assert.AreEqual(true, equal);
} }
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
@@ -370,13 +370,6 @@ namespace Newtonsoft.Json.Tests.Serialization
string json = JsonConvert.SerializeObject(person, Formatting.Indented); string json = JsonConvert.SerializeObject(person, Formatting.Indented);
Console.WriteLine(json);
//{
// "Name": "George Michael Bluth",
// "Age": 16,
// "Title": "Mister Manager"
//}
StringAssert.AreEqual(@"{ StringAssert.AreEqual(@"{
""Name"": ""George Michael Bluth"", ""Name"": ""George Michael Bluth"",
""Age"": 16, ""Age"": 16,
@@ -219,45 +219,32 @@ namespace Newtonsoft.Json.Tests.Serialization
{ {
SerializationEventTestObject obj = new SerializationEventTestObject(); SerializationEventTestObject obj = new SerializationEventTestObject();
Console.WriteLine(obj.Member1); Assert.AreEqual(11, obj.Member1);
// 11 Assert.AreEqual("Hello World!", obj.Member2);
Console.WriteLine(obj.Member2); Assert.AreEqual("This is a nonserialized value", obj.Member3);
// Hello World! Assert.AreEqual(null, obj.Member4);
Console.WriteLine(obj.Member3); Assert.AreEqual(null, obj.Member5);
// This is a nonserialized value
Console.WriteLine(obj.Member4);
// null
Console.WriteLine(obj.Member5);
// null
string json = JsonConvert.SerializeObject(obj, Formatting.Indented); string json = JsonConvert.SerializeObject(obj, Formatting.Indented);
// { Assert.AreEqual(@"{
// "Member1": 11, ""Member1"": 11,
// "Member2": "This value went into the data file during serialization.", ""Member2"": ""This value went into the data file during serialization."",
// "Member4": null ""Member4"": null
// } }", json);
Console.WriteLine(obj.Member1); Assert.AreEqual(11, obj.Member1);
// 11 Assert.AreEqual("This value was reset after serialization.", obj.Member2);
Console.WriteLine(obj.Member2); Assert.AreEqual("This is a nonserialized value", obj.Member3);
// This value was reset after serialization. Assert.AreEqual(null, obj.Member4);
Console.WriteLine(obj.Member3); Assert.AreEqual("Error message for member Member6 = Error getting value from 'Member6' on 'Newtonsoft.Json.Tests.TestObjects.SerializationEventTestObject'.", obj.Member5);
// This is a nonserialized value
Console.WriteLine(obj.Member4);
// null
Console.WriteLine(obj.Member5);
// Error message for member Member6 = Exception has been thrown by the target of an invocation.
obj = JsonConvert.DeserializeObject<SerializationEventTestObject>(json); obj = JsonConvert.DeserializeObject<SerializationEventTestObject>(json);
Console.WriteLine(obj.Member1); Assert.AreEqual(11, obj.Member1);
// 11 Assert.AreEqual("This value went into the data file during serialization.", obj.Member2);
Console.WriteLine(obj.Member2); Assert.AreEqual("This value was set during deserialization", obj.Member3);
// This value went into the data file during serialization. Assert.AreEqual("This value was set after deserialization.", obj.Member4);
Console.WriteLine(obj.Member3); Assert.AreEqual(null, obj.Member5);
// This value was set during deserialization
Console.WriteLine(obj.Member4);
// This value was set after deserialization.
} }
public class SerializationEventBaseTestObject public class SerializationEventBaseTestObject
@@ -356,9 +343,6 @@ namespace Newtonsoft.Json.Tests.Serialization
// persisted "Id" value into the renamed "Identifier" // persisted "Id" value into the renamed "Identifier"
// property, etc. // property, etc.
error.Handled = true; error.Handled = true;
// We never get here :(
Console.WriteLine("Error has been fixed");
} }
} }
@@ -135,8 +135,6 @@ namespace Newtonsoft.Json.Tests.Serialization
jsonSerializer.Serialize(jsonWriter, f, typeof(Foo1)); jsonSerializer.Serialize(jsonWriter, f, typeof(Foo1));
} }
Console.WriteLine("Trace output:\n{0}", traceWriter.ToString());
return sw.ToString(); return sw.ToString();
} }
@@ -190,7 +188,17 @@ namespace Newtonsoft.Json.Tests.Serialization
// } // }
// ] // ]
Console.WriteLine(json); Assert.AreEqual(@"[
{
""Name"": ""Joe Employee"",
""Manager"": {
""Name"": ""Mike Manager""
}
},
{
""Name"": ""Mike Manager""
}
]", json);
} }
[Test] [Test]
@@ -322,17 +330,26 @@ namespace Newtonsoft.Json.Tests.Serialization
// "Name": "Martha Family Details" // "Name": "Martha Family Details"
// } // }
//] //]
Console.WriteLine(json);
Assert.AreEqual(@"[
{
""Name"": ""Joe Family Details"",
""NumberOfChildren"": 4
},
{
""Name"": ""Martha Family Details""
}
]", json);
string mikeString = "{\"Name\": \"Mike Person\"}"; string mikeString = "{\"Name\": \"Mike Person\"}";
FamilyDetails mike = JsonConvert.DeserializeObject<FamilyDetails>(mikeString); FamilyDetails mike = JsonConvert.DeserializeObject<FamilyDetails>(mikeString);
Console.WriteLine("mikeString specifies number of children: {0}", mike.NumberOfChildrenSpecified); Assert.AreEqual(false, mike.NumberOfChildrenSpecified);
string mikeFullDisclosureString = "{\"Name\": \"Mike Person\", \"NumberOfChildren\": \"0\"}"; string mikeFullDisclosureString = "{\"Name\": \"Mike Person\", \"NumberOfChildren\": \"0\"}";
mike = JsonConvert.DeserializeObject<FamilyDetails>(mikeFullDisclosureString); mike = JsonConvert.DeserializeObject<FamilyDetails>(mikeFullDisclosureString);
Console.WriteLine("mikeString specifies number of children: {0}", mike.NumberOfChildrenSpecified); Assert.AreEqual(true, mike.NumberOfChildrenSpecified);
} }
[Test] [Test]
@@ -90,7 +90,6 @@ Newtonsoft.Json Error: 0 : Error!
staff, staff,
new JsonSerializerSettings { TraceWriter = traceWriter, Converters = { new JavaScriptDateTimeConverter() } }); new JsonSerializerSettings { TraceWriter = traceWriter, Converters = { new JavaScriptDateTimeConverter() } });
Console.WriteLine(traceWriter);
// 2012-11-11T12:08:42.761 Info Started serializing Newtonsoft.Json.Tests.Serialization.Staff. Path ''. // 2012-11-11T12:08:42.761 Info Started serializing Newtonsoft.Json.Tests.Serialization.Staff. Path ''.
// 2012-11-11T12:08:42.785 Info Started serializing System.DateTime with converter Newtonsoft.Json.Converters.JavaScriptDateTimeConverter. Path 'StartDate'. // 2012-11-11T12:08:42.785 Info Started serializing System.DateTime with converter Newtonsoft.Json.Converters.JavaScriptDateTimeConverter. Path 'StartDate'.
// 2012-11-11T12:08:42.791 Info Finished serializing System.DateTime with converter Newtonsoft.Json.Converters.JavaScriptDateTimeConverter. Path 'StartDate'. // 2012-11-11T12:08:42.791 Info Finished serializing System.DateTime with converter Newtonsoft.Json.Converters.JavaScriptDateTimeConverter. Path 'StartDate'.
@@ -150,7 +149,6 @@ Newtonsoft.Json Error: 0 : Error!
MetadataPropertyHandling = MetadataPropertyHandling.Default MetadataPropertyHandling = MetadataPropertyHandling.Default
}); });
Console.WriteLine(traceWriter);
// 2012-11-11T12:08:42.761 Info Started serializing Newtonsoft.Json.Tests.Serialization.Staff. Path ''. // 2012-11-11T12:08:42.761 Info Started serializing Newtonsoft.Json.Tests.Serialization.Staff. Path ''.
// 2012-11-11T12:08:42.785 Info Started serializing System.DateTime with converter Newtonsoft.Json.Converters.JavaScriptDateTimeConverter. Path 'StartDate'. // 2012-11-11T12:08:42.785 Info Started serializing System.DateTime with converter Newtonsoft.Json.Converters.JavaScriptDateTimeConverter. Path 'StartDate'.
// 2012-11-11T12:08:42.791 Info Finished serializing System.DateTime with converter Newtonsoft.Json.Converters.JavaScriptDateTimeConverter. Path 'StartDate'. // 2012-11-11T12:08:42.791 Info Finished serializing System.DateTime with converter Newtonsoft.Json.Converters.JavaScriptDateTimeConverter. Path 'StartDate'.
@@ -878,8 +876,6 @@ Newtonsoft.Json Error: 0 : Error!
traceWriter.Flush(); traceWriter.Flush();
traceWriter.Close(); traceWriter.Close();
Console.WriteLine(traceWriter.GetJson());
StringAssert.AreEqual(@"{ StringAssert.AreEqual(@"{
""Array"": [ ""Array"": [
""String!"", ""String!"",
@@ -1039,8 +1035,6 @@ Newtonsoft.Json Error: 0 : Error!
traceReader.Close(); traceReader.Close();
Console.WriteLine(traceReader.GetJson());
StringAssert.AreEqual(json, traceReader.GetJson()); StringAssert.AreEqual(json, traceReader.GetJson());
} }
#endif #endif
@@ -101,8 +101,6 @@ namespace Newtonsoft.Json.Tests.Serialization
TypeNameHandling = TypeNameHandling.Auto TypeNameHandling = TypeNameHandling.Auto
}); });
Console.WriteLine(json);
StringAssert.AreEqual(@"{ StringAssert.AreEqual(@"{
""Collection"": [ ""Collection"": [
""Collection value!"" ""Collection value!""
@@ -1132,7 +1130,6 @@ namespace Newtonsoft.Json.Tests.Serialization
private void TestJsonSerializationRoundTrip(SerializableWrapper e, TypeNameHandling flag) private void TestJsonSerializationRoundTrip(SerializableWrapper e, TypeNameHandling flag)
{ {
Console.WriteLine("Type Name Handling: " + flag.ToString());
StringWriter writer = new StringWriter(); StringWriter writer = new StringWriter();
//Create our serializer and set Type Name Handling appropriately //Create our serializer and set Type Name Handling appropriately
@@ -1141,8 +1138,6 @@ namespace Newtonsoft.Json.Tests.Serialization
//Do the actual serialization and dump to Console for inspection //Do the actual serialization and dump to Console for inspection
serializer.Serialize(new JsonTextWriter(writer), e); serializer.Serialize(new JsonTextWriter(writer), e);
Console.WriteLine(writer.ToString());
Console.WriteLine();
//Now try to deserialize //Now try to deserialize
//Json.Net will cause an error here as it will try and instantiate //Json.Net will cause an error here as it will try and instantiate
@@ -1653,7 +1648,7 @@ namespace Newtonsoft.Json.Tests.Serialization
public void SerializeDeserialize_DictionaryContextContainsGuid_DeserializesItemAsGuid() public void SerializeDeserialize_DictionaryContextContainsGuid_DeserializesItemAsGuid()
{ {
const string contextKey = "k1"; const string contextKey = "k1";
var someValue = Guid.NewGuid(); var someValue = new Guid("a6e986df-fc2c-4906-a1ef-9492388f7833");
Dictionary<string, Guid> inputContext = new Dictionary<string, Guid>(); Dictionary<string, Guid> inputContext = new Dictionary<string, Guid>();
inputContext.Add(contextKey, someValue); inputContext.Add(contextKey, someValue);
@@ -1665,7 +1660,10 @@ namespace Newtonsoft.Json.Tests.Serialization
}; };
string serializedString = JsonConvert.SerializeObject(inputContext, jsonSerializerSettings); string serializedString = JsonConvert.SerializeObject(inputContext, jsonSerializerSettings);
Console.WriteLine(serializedString); Assert.AreEqual(@"{
""$type"": ""System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Guid, mscorlib]], mscorlib"",
""k1"": ""a6e986df-fc2c-4906-a1ef-9492388f7833""
}", serializedString);
var deserializedObject = (Dictionary<string, Guid>)JsonConvert.DeserializeObject(serializedString, jsonSerializerSettings); var deserializedObject = (Dictionary<string, Guid>)JsonConvert.DeserializeObject(serializedString, jsonSerializerSettings);
@@ -1799,19 +1797,15 @@ namespace Newtonsoft.Json.Tests.Serialization
new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All, TypeNameAssemblyFormat = FormatterAssemblyStyle.Full } // TypeNameHandling.Auto will work new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All, TypeNameAssemblyFormat = FormatterAssemblyStyle.Full } // TypeNameHandling.Auto will work
); );
Console.WriteLine(serialized);
var output = JsonConvert.DeserializeObject<List<Stack<string>>>(serialized, var output = JsonConvert.DeserializeObject<List<Stack<string>>>(serialized,
new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All } new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All }
); );
foreach (var stack in output) List<string> strings = output.SelectMany(s => s).ToList();
{
foreach (var value in stack) Assert.AreEqual(9, strings.Count);
{ Assert.AreEqual("One", strings[0]);
Console.WriteLine(value); Assert.AreEqual("Nine", strings[8]);
}
}
} }
#if !NET20 #if !NET20
@@ -156,7 +156,7 @@ namespace Newtonsoft.Json.Tests.Utilities
private void AssertNewDateTimeParseEqual(string text) private void AssertNewDateTimeParseEqual(string text)
{ {
Console.WriteLine("Parsing date text: " + text); //Console.WriteLine("Parsing date text: " + text);
object oldDt; object oldDt;
TryParseDateIso(text, DateParseHandling.DateTime, DateTimeZoneHandling.RoundtripKind, out oldDt); TryParseDateIso(text, DateParseHandling.DateTime, DateTimeZoneHandling.RoundtripKind, out oldDt);
@@ -92,5 +92,5 @@ using System.Security;
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("7.0.0.0")] [assembly: AssemblyVersion("7.0.0.0")]
[assembly: AssemblyFileVersion("7.0.1.18321")] [assembly: AssemblyFileVersion("7.0.1.18322")]
[assembly: CLSCompliant(true)] [assembly: CLSCompliant(true)]