コード例 #1
0
        public void TestActivate()
        {
            var activate = new activate();

            activate.amount      = 500;
            activate.orderSource = orderSourceType.ecommerce;
            activate.card        = new giftCardCardType();

            batchRequest.addActivate(activate);

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

            mockCnpFile.Verify(cnpFile => cnpFile.createRandomFile(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), mockCnpTime.Object));
            mockCnpFile.Verify(cnpFile => cnpFile.AppendLineToFile(mockFilePath, activate.Serialize()));
        }
コード例 #2
0
        public void testActivate()
        {
            var 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()));
        }
コード例 #3
0
        public void testActivate_VirtualGiftCard()
        {
            var activate = new activate();
            activate.orderId = "12345";
            activate.amount = 200;
            activate.orderSource = orderSourceType.ecommerce;
            activate.id = "theId";
            activate.reportGroup = "theReportGroup";
            activate.virtualGiftCard = new virtualGiftCardType();

            var actual = activate.Serialize();
            var expected = @"
            <activate id=""theId"" reportGroup=""theReportGroup"">
            <orderId>12345</orderId>
            <amount>200</amount>
            <orderSource>ecommerce</orderSource>
            <virtualGiftCard>
            </virtualGiftCard>
            </activate>";
            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void testActivate_VirtualGiftCard()
        {
            activate activate = new activate();

            activate.orderId         = "12345";
            activate.amount          = 200;
            activate.orderSource     = orderSourceType.ecommerce;
            activate.id              = "theId";
            activate.reportGroup     = "theReportGroup";
            activate.virtualGiftCard = new virtualGiftCardType();

            String actual   = activate.Serialize();
            String expected = @"
<activate id=""theId"" reportGroup=""theReportGroup"">
<orderId>12345</orderId>
<amount>200</amount>
<orderSource>ecommerce</orderSource>
<virtualGiftCard>
</virtualGiftCard>
</activate>";

            Assert.AreEqual(Regex.Replace(expected, @"\s+", String.Empty), Regex.Replace(actual, @"\s+", String.Empty));
        }
コード例 #5
0
        public void testActivate_VirtualGiftCard()
        {
            var activate = new activate();

            activate.orderId         = "12345";
            activate.amount          = 200;
            activate.orderSource     = orderSourceType.ecommerce;
            activate.id              = "theId";
            activate.reportGroup     = "theReportGroup";
            activate.virtualGiftCard = new virtualGiftCardType();

            var actual   = activate.Serialize();
            var expected = @"
<activate id=""theId"" reportGroup=""theReportGroup"">
<orderId>12345</orderId>
<amount>200</amount>
<orderSource>ecommerce</orderSource>
<virtualGiftCard>
</virtualGiftCard>
</activate>";

            Assert.AreEqual(expected, actual);
        }
コード例 #6
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);
        }
コード例 #7
0
        public void TestActivate()
        {
            var 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()));
        }