Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        public void IntegrationTest_Properties()
        {
            DataContainer container        = DomainObjectIDs.Computer1.GetObject <Computer> ().InternalDataContainer;
            TransportItem item             = TransportItem.PackageDataContainer(container);
            TransportItem deserializedItem = SerializeAndDeserialize(item);

            TransportItemTest.CheckEqualData(container, deserializedItem);
        }
Exemplo n.º 3
0
        public void IntegrationTest_ClassesWithAllDataTypes()
        {
            DataContainer container1 = DomainObjectIDs.ClassWithAllDataTypes1.GetObject <ClassWithAllDataTypes> ().InternalDataContainer;
            DataContainer container2 = DomainObjectIDs.ClassWithAllDataTypes2.GetObject <ClassWithAllDataTypes> ().InternalDataContainer;
            TransportItem item1      = TransportItem.PackageDataContainer(container1);
            TransportItem item2      = TransportItem.PackageDataContainer(container2);

            TransportItem[] deserializedItems = SerializeAndDeserialize(new[] { item1, item2 });

            TransportItemTest.CheckEqualData(container1, deserializedItems[0]);
            TransportItemTest.CheckEqualData(container2, deserializedItems[1]);
        }
Exemplo n.º 4
0
        public void IntegrationTest_Multiple()
        {
            DataContainer container1 = DomainObjectIDs.Computer1.GetObject <Computer> ().InternalDataContainer;
            DataContainer container2 = DomainObjectIDs.Computer2.GetObject <Computer> ().InternalDataContainer;
            TransportItem item1      = TransportItem.PackageDataContainer(container1);
            TransportItem item2      = TransportItem.PackageDataContainer(container2);

            TransportItem[] deserializedItems = SerializeAndDeserialize(new[] { item1, item2 });

            TransportItemTest.CheckEqualData(container1, deserializedItems[0]);
            TransportItemTest.CheckEqualData(container2, deserializedItems[1]);
        }