Litle.Sdk.load.Serialize C# (CSharp) Method

Serialize() public method

public Serialize ( ) : string
return string
        public override string Serialize()
        {
            string xml = "\r\n<load";
            xml += " id=\"" + SecurityElement.Escape(id) + "\"";
            if (customerId != null)
            {
                xml += " customerId=\"" + SecurityElement.Escape(customerId) + "\"";
            }
            xml += " reportGroup=\"" + SecurityElement.Escape(reportGroup) + "\">";
            xml += "\r\n<orderId>" + SecurityElement.Escape(orderId) + "</orderId>";
            xml += "\r\n<amount>" + amount + "</amount>";
            xml += "\r\n<orderSource>" + orderSource.Serialize() + "</orderSource>";
            xml += "\r\n<card>" + card.Serialize() + "\r\n</card>";
            xml += "\r\n</load>";
            return xml;
        }

Usage Example

コード例 #1
0
        public void testLoad_OnlyRequired()
        {
            load load = new load();
            load.orderId = "12345";
            load.amount = 200;
            load.orderSource = orderSourceType.ecommerce;
            load.card = new cardType();
            load.id = "theId";
            load.reportGroup = "theReportGroup";

            String actual = load.Serialize();
            String expected = @"
            <load id=""theId"" reportGroup=""theReportGroup"">
            <orderId>12345</orderId>
            <amount>200</amount>
            <orderSource>ecommerce</orderSource>
            <card>
            <type>MC</type>
            </card>
            </load>";
            Assert.AreEqual(expected, actual);
        }
All Usage Examples Of Litle.Sdk.load::Serialize