-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
+1 -1
View File
@@ -19,7 +19,7 @@
$builds = @(
@{Name = "Newtonsoft.Json"; TestsName = "Newtonsoft.Json.Tests"; Constants=""; FinalDir="Net45"; NuGetDir = "net45"; Framework="net-4.0"; Sign=$true},
@{Name = "Newtonsoft.Json.Portable"; TestsName = "Newtonsoft.Json.Tests.Portable"; Constants="PORTABLE"; FinalDir="Portable"; NuGetDir = "portable-net45+wp80+win8+wpa81"; Framework="net-4.0"; Sign=$true},
@{Name = "Newtonsoft.Json.Portable40"; TestsName = "Newtonsoft.Json.Tests.Portable40"; Constants="PORTABLE40"; FinalDir="Portable40"; NuGetDir = "portable-net40+sl4+wp7+win8+wpa81"; Framework="net-4.0"; Sign=$true},
@{Name = "Newtonsoft.Json.Portable40"; TestsName = "Newtonsoft.Json.Tests.Portable40"; Constants="PORTABLE40"; FinalDir="Portable40"; NuGetDir = "portable-net40+sl5+wp80+win8+wpa81"; Framework="net-4.0"; Sign=$true},
@{Name = "Newtonsoft.Json.WinRT"; TestsName = $null; Constants="NETFX_CORE"; FinalDir="WinRT"; NuGetDir = "netcore45"; Framework="net-4.5"; Sign=$true},
@{Name = "Newtonsoft.Json.Net40"; TestsName = "Newtonsoft.Json.Tests.Net40"; Constants="NET40"; FinalDir="Net40"; NuGetDir = "net40"; Framework="net-4.0"; Sign=$true},
@{Name = "Newtonsoft.Json.Net35"; TestsName = "Newtonsoft.Json.Tests.Net35"; Constants="NET35"; FinalDir="Net35"; NuGetDir = "net35"; Framework="net-2.0"; Sign=$true},
@@ -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;
}