Serialize() public method

public Serialize ( ) : string
return string
コード例 #1
0
        public void testActivate()
        {
            activate activate = new activate();
            activate.amount = 500;
            activate.orderSource = orderSourceType.ecommerce;
            activate.card = new cardType();

            batchRequest.addActivate(activate);

            Assert.AreEqual(1, batchRequest.getNumActivates());
            Assert.AreEqual(500, batchRequest.getActivateAmount());

            mockLitleFile.Verify(litleFile => litleFile.createRandomFile(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<String>(), mockLitleTime.Object));
            mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(mockFilePath, activate.Serialize()));
        }
コード例 #2
0
        public void testActivate_Full()
        {
            activate activate = new activate();
            activate.orderId = "12345";
            activate.amount = 200;
            activate.orderSource = orderSourceType.ecommerce;
            activate.id = "theId";
            activate.reportGroup = "theReportGroup";
            activate.card = new cardType();

            String actual = activate.Serialize();
            String expected = @"
            <activate id=""theId"" reportGroup=""theReportGroup"">
            <orderId>12345</orderId>
            <amount>200</amount>
            <orderSource>ecommerce</orderSource>
            <card>
            <type>MC</type>
            </card>
            </activate>";
            Assert.AreEqual(expected, actual);
        }