-Fixed error when writing JSON for a JProperty with no value
-LINQ to JSON performance improvements
This commit is contained in:
@@ -52,6 +52,17 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
[TestFixture]
|
||||
public class JObjectTests : TestFixtureBase
|
||||
{
|
||||
[Test]
|
||||
public void WritePropertyWithNoValue()
|
||||
{
|
||||
var o = new JObject();
|
||||
o.Add(new JProperty("novalue"));
|
||||
|
||||
Assert.AreEqual(@"{
|
||||
""novalue"": null
|
||||
}", o.ToString());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Keys()
|
||||
{
|
||||
@@ -1360,7 +1371,7 @@ Parameter name: arrayIndex",
|
||||
public void IBindingListAddNewWithEvent()
|
||||
{
|
||||
JObject o = new JObject();
|
||||
o.AddingNew += (s, e) => e.NewObject = new JProperty("Property!");
|
||||
o._addingNew += (s, e) => e.NewObject = new JProperty("Property!");
|
||||
|
||||
IBindingList l = o;
|
||||
object newObject = l.AddNew();
|
||||
@@ -1441,7 +1452,7 @@ Parameter name: arrayIndex",
|
||||
NotifyCollectionChangedAction? changedType = null;
|
||||
int? index = null;
|
||||
|
||||
o.CollectionChanged += (s, a) =>
|
||||
o._collectionChanged += (s, a) =>
|
||||
{
|
||||
changedType = a.Action;
|
||||
index = a.NewStartingIndex;
|
||||
|
||||
Reference in New Issue
Block a user