Ejemplo n.º 1
0
        public void WriteXmlWithCollectionPropertyTest()
        {
            var value = new ClassWithCollectionProperty
            {
                Name    = "two",
                Numbers = new List <int> {
                    1, 2
                }
            };

            var actual   = GetConverter().ToXml(value);
            var expected = @"<xml><name>two</name><number>1</number><number>2</number></xml>";

            Assert.That(actual, IsXml.Equals(expected));
        }
Ejemplo n.º 2
0
        public void ReadXmlWithCollectionPropertyTest()
        {
            var xml = @"<xml><name>two</name><number>1</number><number>2</number></xml>";

            var expected = new ClassWithCollectionProperty
            {
                Name    = "two",
                Numbers = new List <int> {
                    1, 2
                }
            };

            var actual = GetConverter().ParseXml <ClassWithCollectionProperty>(xml);

            Assert.AreEqual(expected, actual);
        }