-Documentation

-Test
This commit is contained in:
James Newton-King
2016-07-20 12:14:10 +12:00
parent dada8ea0e3
commit 7ac27587c0
2 changed files with 36 additions and 2 deletions
@@ -1510,5 +1510,39 @@ keyword such as type of business.""
string json = t.ToString();
return json;
}
[Test]
public void HashCodeTests()
{
JObject o1 = new JObject
{
["prop"] = 1
};
JObject o2 = new JObject
{
["prop"] = 1
};
Assert.IsFalse(ReferenceEquals(o1, o2));
Assert.IsFalse(Equals(o1, o2));
Assert.IsFalse(o1.GetHashCode() == o2.GetHashCode());
Assert.IsTrue(o1.GetDeepHashCode() == o2.GetDeepHashCode());
Assert.IsTrue(JToken.DeepEquals(o1, o2));
JArray a1 = new JArray
{
1
};
JArray a2 = new JArray
{
1
};
Assert.IsFalse(ReferenceEquals(a1, a2));
Assert.IsFalse(Equals(a1, a2));
Assert.IsFalse(a1.GetHashCode() == a2.GetHashCode());
Assert.IsTrue(a1.GetDeepHashCode() == a2.GetDeepHashCode());
Assert.IsTrue(JToken.DeepEquals(a1, a2));
}
}
}
@@ -50,9 +50,9 @@ namespace Newtonsoft.Json.Converters
public bool CamelCaseText { get; set; }
/// <summary>
/// Gets or sets a value indicating whether integer values are allowed.
/// Gets or sets a value indicating whether integer values are allowed when deserializing.
/// </summary>
/// <value><c>true</c> if integers are allowed; otherwise, <c>false</c>.</value>
/// <value><c>true</c> if integers are allowed when deserializing; otherwise, <c>false</c>.</value>
public bool AllowIntegerValues { get; set; }
/// <summary>