Beispiel #1
0
        public void Can_serialize_simple_POCO_With_Attribute_Options_Defined_And_Property_Containing_IList_Elements()
        {
            var poco = new WackyPerson
            {
                Name        = "Foo",
                Age         = 50,
                Price       = 19.95m,
                StartDate   = new DateTime(2009, 12, 18, 10, 2, 23),
                ContactData = new ContactData
                {
                    EmailAddresses = new List <EmailAddress>
                    {
                        new EmailAddress
                        {
                            Address  = "*****@*****.**",
                            Location = "Work"
                        }
                    }
                }
            };
            var xml      = new XmlSerializer();
            var doc      = xml.Serialize(poco);
            var expected = GetSimplePocoXDocWackyNamesWithIListProperty();

            Assert.Equal(expected.ToString(), doc.ToString());
        }
Beispiel #2
0
        public void Can_serialize_simple_POCO_With_Attribute_Options_Defined()
        {
            var poco = new WackyPerson
            {
                Name      = "Foo",
                Age       = 50,
                Price     = 19.95m,
                StartDate = new DateTime(2009, 12, 18, 10, 2, 23)
            };
            var xml      = new XmlSerializer();
            var doc      = xml.Serialize(poco);
            var expected = GetSimplePocoXDocWackyNames();

            Assert.Equal(expected.ToString(), doc.ToString());
        }
        public void Can_serialize_simple_POCO_With_Attribute_Options_Defined()
        {
            var poco = new WackyPerson {
                Name = "Foo",
                Age = 50,
                Price = 19.95m,
                StartDate = new DateTime(2009, 12, 18, 10, 2, 23)
            };

            var xml = new XmlSerializer();
            var doc = xml.Serialize(poco);
            var expected = GetSimplePocoXDocWackyNames();

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