public void TestVariantMultipleDoesNotEqual(ApiVersion version) { Guid id = new Guid("11111111-2222-3333-4444-555555555555"); Guid id2 = new Guid("11111111-2222-3333-4444-555555555555"); string json1, json2; if (version < ApiVersion.v3) { json1 = @"{ ""item"": { ""attr"": ""stringvalue"" } }"; json2 = @"{ ""item"": { ""attr"": ""stringvalwe"" } }"; } else { json1 = @"{ ""item"": { ""attr"": ""stringvalue"" } }"; json2 = @"{ ""item"": { ""attr"": ""stringvalwe"" } }"; } Variant v = new Variant(id, JToken.Parse(json1), "attr", testCulture, version); Variant v2 = new Variant(id2, JToken.Parse(json2), "attr", testCulture, version); List <Variant> vlist = new List <Variant>() { v }; List <Variant> vlist2 = new List <Variant>() { v2 }; VariantMultiple vm = new VariantMultiple(id, vlist); VariantMultiple vm2 = new VariantMultiple(id2, vlist2); Assert.AreNotEqual(vm.GetHashCode(), vm2.GetHashCode()); Assert.AreNotEqual(vm, vm2); }
public void TestVariantMultipleEqual(ApiVersion version) { Guid id = new Guid("11111111-2222-3333-4444-555555555555"); Guid idCopy = new Guid("11111111-2222-3333-4444-555555555555"); string json; if (version < ApiVersion.v3) { json = @"{ ""item"": { ""attr"": ""stringvalue"" } }"; } else { json = @"{ ""item"": { ""attr"": ""stringvalue"" } }"; } Variant v = new Variant(id, JToken.Parse(json), "attr", testCulture, version); Variant vCopy = new Variant(idCopy, JToken.Parse(json), "attr", testCulture, version); List <Variant> vlist = new List <Variant>() { v }; List <Variant> vlistCopy = new List <Variant>() { vCopy }; VariantMultiple vm = new VariantMultiple(id, vlist); VariantMultiple vmCopy = new VariantMultiple(idCopy, vlistCopy); Assert.AreEqual(vm.GetHashCode(), vmCopy.GetHashCode()); Assert.AreEqual(vm, vmCopy); }