コード例 #1
0
        public void Can_Deserialize_An_Address_Stored_In_A_Serialized_ExtendedDataCollection()
        {
            //// Arrange
            var extendedDataContainer = new ExtendedDataCollection();
            var extendedDataWrapper = new ExtendedDataCollection();
            extendedDataWrapper.AddAddress(_address, AddressType.Shipping);
            extendedDataContainer.AddExtendedDataCollection(extendedDataWrapper);

            //// Act
            var wrapper = extendedDataContainer.GetExtendedDataCollection();
            var address = wrapper.GetAddress(AddressType.Shipping);

            //// Assert
            Assert.NotNull(address);
            Assert.AreEqual(typeof(Address), address.GetType());
        }
コード例 #2
0
        public void Can_Deserialize_An_Address_Stored_In_A_Serialized_ExtendedDataCollection()
        {
            //// Arrange
            var extendedDataContainer = new ExtendedDataCollection();
            var extendedDataWrapper   = new ExtendedDataCollection();

            extendedDataWrapper.AddAddress(_address, AddressType.Shipping);
            extendedDataContainer.AddExtendedDataCollection(extendedDataWrapper);

            //// Act
            var wrapper = extendedDataContainer.GetExtendedDataCollection();
            var address = wrapper.GetAddress(AddressType.Shipping);

            //// Assert
            Assert.NotNull(address);
            Assert.AreEqual(typeof(Address), address.GetType());
        }
コード例 #3
0
        public void Can_Deserialize_A_LineItemCollection_Stored_In_A_Serialized_ExtendedDataCollection()
        {
            //// Arrange
            var extendedDataContainer = new ExtendedDataCollection();
            var extendedDataWrapper   = new ExtendedDataCollection();

            extendedDataWrapper.AddLineItemCollection(_shipment.Items);
            extendedDataContainer.AddExtendedDataCollection(extendedDataWrapper);
            Console.Write(extendedDataContainer.SerializeToXml());

            //// Act
            var retrievedExtendedDataWrapper = extendedDataContainer.GetExtendedDataCollection();

            Assert.NotNull(retrievedExtendedDataWrapper);
            var lineItemCollection = retrievedExtendedDataWrapper.GetLineItemCollection <ItemCacheLineItem>();

            //// Assert
            Assert.NotNull(lineItemCollection);
            Assert.IsTrue(lineItemCollection.Any());
        }
コード例 #4
0
        public void Can_Deserialize_A_LineItemCollection_Stored_In_A_Serialized_ExtendedDataCollection()
        {
            //// Arrange
            var extendedDataContainer = new ExtendedDataCollection();
            var extendedDataWrapper = new ExtendedDataCollection();
            extendedDataWrapper.AddLineItemCollection(_shipment.Items);
            extendedDataContainer.AddExtendedDataCollection(extendedDataWrapper);
            Console.Write(extendedDataContainer.SerializeToXml());

            //// Act
            var retrievedExtendedDataWrapper = extendedDataContainer.GetExtendedDataCollection();
            Assert.NotNull(retrievedExtendedDataWrapper);
            var lineItemCollection = retrievedExtendedDataWrapper.GetLineItemCollection<ItemCacheLineItem>();

            //// Assert
            Assert.NotNull(lineItemCollection);
            Assert.IsTrue(lineItemCollection.Any());
        }