-Documentation
-Test
This commit is contained in:
@@ -1510,5 +1510,39 @@ keyword such as type of business.""
|
|||||||
string json = t.ToString();
|
string json = t.ToString();
|
||||||
return json;
|
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; }
|
public bool CamelCaseText { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </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; }
|
public bool AllowIntegerValues { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user