Exemplo n.º 1
0
        public void XmlSerializationWithXmlIgnore()
        {
            var obj = new ObjectWithXmlMappings();

            string xml = obj.ToXml().ToString();

            Assert.IsFalse(xml.Contains("IgnoredProperty"));
        }
            public void ReturnsRightPropertyNameWithMappings()
            {
                // Required to have properties registered
                var objectWithXmlMappings = new ObjectWithXmlMappings();

                objectWithXmlMappings.ToString();

                string propertyName = ObjectWithXmlMappings.PropertyDataManager.MapXmlElementNameToPropertyName(typeof(ObjectWithXmlMappings), "MappedXmlProperty");

                Assert.AreEqual("PropertyWithMapping", propertyName);
            }