コード例 #1
0
        public void XmlElement()
        {
            var obj = new TestClassWithXmlElementAttribute {
                Id = 123
            };

            CheckSerializationAndDeserializationByXml(
                @"<TestClassWithXmlElementAttribute type=""ExtendedXmlSerialization.Test.TestObject.TestClassWithXmlElementAttribute"">
  <Identifier>123</Identifier>
</TestClassWithXmlElementAttribute>", obj);
            CheckCompatibilityWithDefaultSerializator(obj);
        }
コード例 #2
0
        public void XmlElementAttribute()
        {
            var expected = new TestClassWithXmlElementAttribute {
                Id = 123
            };
            var actual = new SerializationSupport().Assert(
                expected,
                @"<?xml version=""1.0"" encoding=""utf-8""?><TestClassWithXmlElementAttribute xmlns=""clr-namespace:ExtendedXmlSerializer.Tests.TestObject;assembly=ExtendedXmlSerializer.Tests""><Identifier>123</Identifier></TestClassWithXmlElementAttribute>"
                );

            Assert.Equal(expected.Id, actual.Id);
        }