Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            var property = obj as ObjectWithListProperty;

            return(property != null && (Elements == property.Elements ||
                                        EnumerableExtentions.IsItemsEqual(Elements, property.Elements)));
        }
Exemplo n.º 2
0
        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!");
        }
Exemplo n.º 3
0
 public bool Equals(ObjectWithReferenceContainer other)
 {
     return(EnumerableExtentions.IsItemsEqual(NamedElements, other.NamedElements) &&
            Holder.Equals(other.Holder));
 }
Exemplo n.º 4
0
        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));
        }