Serialize() public méthode

public Serialize ( ) : string
Résultat string
        public void TestCreatePlan_Full()
        {
            createPlan create = new createPlan();
            create.planCode = "abc";
            create.name = "thePlan";
            create.description = "theDescription";
            create.intervalType = intervalType.ANNUAL;
            create.amount = 100;
            create.numberOfPayments = 3;
            create.trialNumberOfIntervals = 2;
            create.trialIntervalType = trialIntervalType.MONTH;
            create.active = true;

            String actual = create.Serialize();
            String expected = @"
            <createPlan>
            <planCode>abc</planCode>
            <name>thePlan</name>
            <description>theDescription</description>
            <intervalType>ANNUAL</intervalType>
            <amount>100</amount>
            <numberOfPayments>3</numberOfPayments>
            <trialNumberOfIntervals>2</trialNumberOfIntervals>
            <trialIntervalType>MONTH</trialIntervalType>
            <active>true</active>
            </createPlan>";
            Assert.AreEqual(expected, actual);
        }
        public void TestCreatePlan_OnlyRequired()
        {
            createPlan create = new createPlan();
            create.planCode = "abc";
            create.name = "thePlan";
            create.intervalType = intervalType.ANNUAL;
            create.amount = 100;

            String actual = create.Serialize();
            String expected = @"
            <createPlan>
            <planCode>abc</planCode>
            <name>thePlan</name>
            <intervalType>ANNUAL</intervalType>
            <amount>100</amount>
            </createPlan>";
            Assert.AreEqual(expected, actual);
        }
        public void testCreatePlan()
        {
            createPlan createPlan = new createPlan();

            batchRequest.addCreatePlan(createPlan);

            Assert.AreEqual(1, batchRequest.getNumCreatePlans());

            mockLitleFile.Verify(litleFile => litleFile.createRandomFile(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<String>(), mockLitleTime.Object));
            mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(mockFilePath, createPlan.Serialize()));
        }