-Fixed incorrect NuGet targets on portable assembly

-Fixed using JTokenEqualityComparer with JProperties that have no value
This commit is contained in:
James Newton-King
2014-07-19 12:48:20 +12:00
parent 51212d92b1
commit 70b0813551
3 changed files with 21 additions and 1 deletions
@@ -24,6 +24,7 @@
#endregion
using System.Collections.Generic;
using System.Linq;
#if !NETFX_CORE
using NUnit.Framework;
#else
@@ -38,6 +39,22 @@ namespace Newtonsoft.Json.Tests.Linq
[TestFixture]
public class JTokenEqualityComparerTests : TestFixtureBase
{
[Test]
public void CompareEmptyProperties()
{
JObject o1 = JObject.Parse("{}");
o1.Add(new JProperty("hi"));
JObject o2 = JObject.Parse("{}");
o2.Add(new JProperty("hi"));
JTokenEqualityComparer c = new JTokenEqualityComparer();
Assert.IsTrue(c.Equals(o1, o2));
o1["hi"] = 10;
Assert.IsFalse(c.Equals(o1, o2));
}
[Test]
public void JValueDictionary()
{
@@ -221,6 +221,9 @@ namespace Newtonsoft.Json.Linq
JProperty p1 = (JProperty)keyAndProperty.Value;
JProperty p2 = (JProperty)secondValue;
if (p1.Value == null)
return (p2.Value == null);
if (!p1.Value.DeepEquals(p2.Value))
return false;
}