Exemplo n.º 1
0
        public void AttributeWithDefaultNamespaceAsMemberDeserializationTest()
        {
            var    serializer   = new YAXSerializer(typeof(AttributeWithNamespaceAsMember), YAXExceptionHandlingPolicies.DoNotThrow, YAXExceptionTypes.Warning, YAXSerializationOptions.SerializeNullObjects);
            string got          = serializer.Serialize(AttributeWithNamespaceAsMember.GetSampleInstance());
            var    deserialized = serializer.Deserialize(got) as AttributeWithNamespaceAsMember;

            Assert.That(deserialized, Is.Not.Null);
            Assert.That(serializer.ParsingErrors, Has.Count.EqualTo(0));
        }
Exemplo n.º 2
0
        public void AttributeWithDefaultNamespaceAsMemberSerializationTest()
        {
            const string result =
                @"<AttributeWithNamespaceAsMember xmlns:w=""http://example.com/namespace"">
  <w:Member w:name=""Arial"" />
</AttributeWithNamespaceAsMember>";

            var    serializer = new YAXSerializer(typeof(AttributeWithNamespaceAsMember), YAXExceptionHandlingPolicies.DoNotThrow, YAXExceptionTypes.Warning, YAXSerializationOptions.SerializeNullObjects);
            string got        = serializer.Serialize(AttributeWithNamespaceAsMember.GetSampleInstance());

            Assert.That(got, Is.EqualTo(result));
        }