コード例 #1
0
        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(Regex.Replace(expected, @"\s+", String.Empty), Regex.Replace(actual, @"\s+", String.Empty));
        }
コード例 #2
0
        public void TestCreatePlan()
        {
            var createPlan = new createPlan();

            batchRequest.addCreatePlan(createPlan);

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

            mockCnpFile.Verify(cnpFile => cnpFile.createRandomFile(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), mockCnpTime.Object));
            mockCnpFile.Verify(cnpFile => cnpFile.AppendLineToFile(mockFilePath, createPlan.Serialize()));
        }
コード例 #3
0
        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(Regex.Replace(expected, @"\s+", String.Empty), Regex.Replace(actual, @"\s+", String.Empty));
        }
コード例 #4
0
        public void TestCreatePlan_OnlyRequired()
        {
            var create = new createPlan();

            create.planCode     = "abc";
            create.name         = "thePlan";
            create.intervalType = intervalType.ANNUAL;
            create.amount       = 100;

            var actual   = create.Serialize();
            var expected = @"
<createPlan>
<planCode>abc</planCode>
<name>thePlan</name>
<intervalType>ANNUAL</intervalType>
<amount>100</amount>
</createPlan>";

            Assert.AreEqual(expected, actual);
        }
コード例 #5
0
        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()));
        }
コード例 #6
0
        public void TestCreatePlan_OnlyRequired()
        {
            var create = new createPlan();
            create.planCode = "abc";
            create.name = "thePlan";
            create.intervalType = intervalType.ANNUAL;
            create.amount = 100;

            var actual = create.Serialize();
            var expected = @"
            <createPlan>
            <planCode>abc</planCode>
            <name>thePlan</name>
            <intervalType>ANNUAL</intervalType>
            <amount>100</amount>
            </createPlan>";
            Assert.AreEqual(expected, actual);
        }
コード例 #7
0
        public void TestCreatePlan_Full()
        {
            var 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;

            var actual = create.Serialize();
            var 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);
        }
コード例 #8
0
        public void testCreatePlan()
        {
            var 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()));
        }