public void ContentsEqual() { JsonValue array1 = new JsonArray { 1, false }; JsonValue array2 = new JsonArray { 1, false }; Assert.IsTrue(array1.Equals(array2)); }
public void SequenceEqual() { JsonValue array1 = new JsonArray { 1, false }; JsonValue array2 = new JsonArray { 1, false }; Assert.IsTrue(array1.Equals(array2)); }
public void SequenceNotEqual() { JsonValue array1 = new JsonArray { 1, false }; JsonValue array2 = new JsonArray { false, 1 }; Assert.IsFalse(array1.Equals(array2)); }
public void Equals_SameValuesSameOrder_ReturnsTrue() { var json1 = new JsonArray { false, 42, "a string" }; var json2 = new JsonArray { false, 42, "a string" }; Assert.IsTrue(json1.Equals(json2)); }
public void Equals_DifferentValues_ReturnsFalse() { var json1 = new JsonArray { false, 42, "a string" }; var json2 = new JsonArray { false, "42", "a string" }; Assert.IsFalse(json1.Equals(json2)); }
public void Equals_SameValuesDifferentOrder_ReturnsFalse() { var json1 = new JsonArray { false, 42, "a string" }; var json2 = new JsonArray { 42, false, "a string" }; Assert.IsFalse(json1.Equals(json2)); }
public void SequenceEqualOverride() { JsonValue array1 = new JsonArray { 1, false }; array1.Array.EqualityStandard = ArrayEquality.ContentsEqual; JsonValue array2 = new JsonArray { false, 1 }; Assert.IsTrue(array1.Equals(array2)); }
public void ContentsNotEqual() { JsonOptions.DefaultArrayEquality = ArrayEquality.ContentsEqual; JsonValue array1 = new JsonArray { 1, false }; JsonValue array2 = new JsonArray { false, 1 }; try { Assert.IsTrue(array1.Equals(array2)); } finally { JsonOptions.DefaultArrayEquality = ArrayEquality.SequenceEqual; } }
public void ContentsNotEqualOverride() { JsonOptions.DefaultArrayEquality = ArrayEquality.ContentsEqual; JsonValue array1 = new JsonArray { 1, false }; array1.Array.EqualityStandard = ArrayEquality.SequenceEqual; JsonValue array2 = new JsonArray { false, 1 }; try { Assert.IsFalse(array1.Equals(array2)); } finally { JsonOptions.DefaultArrayEquality = ArrayEquality.SequenceEqual; } }
public void AddData(JsonArray a, MainActivity.MovieType type) { JsonArray write; switch (type) { case MainActivity.MovieType.ALSO: if (also.Equals(a)) { return; } write = also = a; break; case MainActivity.MovieType.OPEN: if (open.Equals(a)) { return; } write = open = a; break; case MainActivity.MovieType.TOP: if (top.Equals(a)) { return; } write = top = a; break; default: return; } WriteJson(write, type); NotifyDataSetChanged(); }