Example #1
0
        public void XmlDeserialize_WithCustomExtensibleEnumProperty()
        {
            byte[]           serializedArray = Encoding.UTF8.GetBytes(XmlSerializationStrings.XmlForCustomExtensibleEnumProperty);
            XmlTransportItem item            = XmlSerializationHelper.XmlDeserialize <XmlTransportItem> (serializedArray);

            Assert.That(item.TransportItem.Properties["CustomExtensibleEnum"], Is.EqualTo(Color.Values.Red()));
        }
Example #2
0
        public void XmlDeserialize_WithCustomNullProperty()
        {
            byte[]           serializedArray = Encoding.UTF8.GetBytes(XmlSerializationStrings.XmlForCustomNullProperty);
            XmlTransportItem item            = XmlSerializationHelper.XmlDeserialize <XmlTransportItem> (serializedArray);

            Assert.That(item.TransportItem.Properties["CustomNull"], Is.EqualTo(null));
        }
Example #3
0
        public void XmlDeserialize_WithCustomObjectIDProperty()
        {
            byte[]           serializedArray = Encoding.UTF8.GetBytes(XmlSerializationStrings.XmlForCustomObjectIDProperty);
            XmlTransportItem item            = XmlSerializationHelper.XmlDeserialize <XmlTransportItem> (serializedArray);

            Assert.That(item.TransportItem.Properties["CustomReference"], Is.EqualTo(DomainObjectIDs.Order3));
        }
Example #4
0
        public void XmlDeserialize_WithNullObjectID()
        {
            byte[]           serializedArray = Encoding.UTF8.GetBytes(XmlSerializationStrings.XmlForComputer4);
            XmlTransportItem item            = XmlSerializationHelper.XmlDeserialize <XmlTransportItem> (serializedArray);

            Assert.That(item.TransportItem.Properties[ReflectionMappingHelper.GetPropertyName(typeof(Computer), "Employee")], Is.Null);
        }
Example #5
0
        public void XmlDeserialize()
        {
            byte[]           serializedArray = Encoding.UTF8.GetBytes(XmlSerializationStrings.XmlForComputer1);
            XmlTransportItem item            = XmlSerializationHelper.XmlDeserialize <XmlTransportItem> (serializedArray);

            TransportItemTest.CheckEqualData(DomainObjectIDs.Computer1.GetObject <Computer> ().InternalDataContainer, item.TransportItem);
        }
Example #6
0
        public void Unwrap()
        {
            TransportItem item1 = new TransportItem(DomainObjectIDs.Order1);
            TransportItem item2 = new TransportItem(DomainObjectIDs.Order3);

            TransportItem[] items = XmlTransportItem.Unwrap(new[] { new XmlTransportItem(item1), new XmlTransportItem(item2) });
            Assert.That(items.Length, Is.EqualTo(2));
            Assert.That(items[0], Is.EqualTo(item1));
            Assert.That(items[1], Is.EqualTo(item2));
        }
Example #7
0
        public void Wrap()
        {
            TransportItem item1 = new TransportItem(DomainObjectIDs.Order1);
            TransportItem item2 = new TransportItem(DomainObjectIDs.Order3);

            XmlTransportItem[] xmlItems = XmlTransportItem.Wrap(new[] { item1, item2 });
            Assert.That(xmlItems.Length, Is.EqualTo(2));
            Assert.That(xmlItems[0].TransportItem, Is.EqualTo(item1));
            Assert.That(xmlItems[1].TransportItem, Is.EqualTo(item2));
        }
Example #8
0
 private TransportItem[] SerializeAndDeserialize(TransportItem[] items)
 {
     return(XmlTransportItem.Unwrap(XmlSerializationHelper.XmlSerializeAndDeserialize(XmlTransportItem.Wrap(items))));
 }