Esempio n. 1
0
        public void Serializes_Properties_In_Specified_Order()
        {
            var ordered = new OrderedProperties();

            ordered.Name      = "Name";
            ordered.Age       = 99;
            ordered.StartDate = new DateTime(2010, 1, 1);

            var xml      = new XmlSerializer();
            var doc      = xml.Serialize(ordered);
            var expected = GetSortedPropsXDoc();

            Assert.Equal(expected.ToString(), doc.ToString());
        }
Esempio n. 2
0
        public void Serializes_Properties_In_Specified_Order()
        {
            OrderedProperties ordered = new OrderedProperties
            {
                Name      = "Name",
                Age       = 99,
                StartDate = new DateTime(2010, 1, 1)
            };
            XmlSerializer xml      = new XmlSerializer();
            string        doc      = xml.Serialize(ordered);
            XDocument     expected = GetSortedPropsXDoc();

            Assert.AreEqual(expected.ToString(), doc);
        }