Example #1
0
        public void CollectionNamespaceGoesThruRecursiveNoContainingElementDeserializationTest()
        {
            var    serializer   = new YAXSerializer(typeof(CellPhone_CollectionNamespaceGoesThruRecursiveNoContainingElement), YAXExceptionHandlingPolicies.DoNotThrow, YAXExceptionTypes.Warning, YAXSerializationOptions.SerializeNullObjects);
            string got          = serializer.Serialize(CellPhone_CollectionNamespaceGoesThruRecursiveNoContainingElement.GetSampleInstance());
            var    deserialized = serializer.Deserialize(got) as CellPhone_CollectionNamespaceGoesThruRecursiveNoContainingElement;

            Assert.That(deserialized, Is.Not.Null);
            Assert.That(serializer.ParsingErrors, Has.Count.EqualTo(0));
        }
Example #2
0
        public void CollectionNamespaceGoesThruRecursiveNoContainingElementSerializationTest()
        {
            const string result =
                @"<MobilePhone xmlns:app=""http://namespace.org/apps"">
  <DeviceBrand>Samsung Galaxy Nexus</DeviceBrand>
  <OS>Android</OS>
  <app:String>Google Map</app:String>
  <app:String>Google+</app:String>
  <app:String>Google Play</app:String>
</MobilePhone>";
            var    serializer = new YAXSerializer(typeof(CellPhone_CollectionNamespaceGoesThruRecursiveNoContainingElement), YAXExceptionHandlingPolicies.DoNotThrow, YAXExceptionTypes.Warning, YAXSerializationOptions.SerializeNullObjects);
            string got        = serializer.Serialize(CellPhone_CollectionNamespaceGoesThruRecursiveNoContainingElement.GetSampleInstance());

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