public override bool Equals(object obj) { var property = obj as ObjectWithListProperty; return(property != null && (Elements == property.Elements || EnumerableExtentions.IsItemsEqual(Elements, property.Elements))); }
public void ListOfSubProperties_SetItems() { string objectXml = "<ListOfSubProperties>" + "<SubProperties SubPropertyA=\"1AValue\" SubPropertyB=\"1BValue\"/>" + "<SubProperties SubPropertyA=\"2AValue\" SubPropertyB=\"2BValue\"/>" + "</ListOfSubProperties>"; var list = new List <SubProperties>() { new SubProperties { SubPropertyA = "1AValue", SubPropertyB = "1BValue" }, new SubProperties { SubPropertyA = "2AValue", SubPropertyB = "2BValue" }, }; var deserialized = _tester.Deserialize <List <SubProperties> >(objectXml); Assert.IsTrue(EnumerableExtentions.IsItemsEqual(deserialized, list), "Items Are Not Equal!"); }
public bool Equals(ObjectWithReferenceContainer other) { return(EnumerableExtentions.IsItemsEqual(NamedElements, other.NamedElements) && Holder.Equals(other.Holder)); }
public void TestDeserializationList <T>(string xml, T expected) where T : System.Collections.IList { T obj = _deserializer.Deserialize <T>(xml); Assert.IsTrue(EnumerableExtentions.IsItemsEqual(expected, obj)); }