Ejemplo n.º 1
0
        public void TestAddSubmerchantDebit()
        {
            var submerchantDebit = new submerchantDebit();

            submerchantDebit.fundingSubmerchantId = "123456";
            submerchantDebit.submerchantName      = "merchant";
            submerchantDebit.fundsTransferId      = "123467";
            submerchantDebit.amount = 106L;
            var echeck = new echeckType();

            echeck.accType                    = echeckAccountTypeEnum.Checking;
            echeck.accNum                     = "12345657890";
            echeck.routingNum                 = "123456789";
            echeck.checkNum                   = "123455";
            submerchantDebit.accountInfo      = echeck;
            submerchantDebit.customIdentifier = "abc123";

            batchRequest.addSubmerchantDebit(submerchantDebit);

            Assert.AreEqual(1, batchRequest.getNumSubmerchantDebit());
            Assert.AreEqual(106L, batchRequest.getSubmerchantDebitAmount());
            Assert.AreEqual("\r\n<submerchantDebit reportGroup=\"Default Report Group\">\r\n<fundingSubmerchantId>123456</fundingSubmerchantId>\r\n<submerchantName>merchant</submerchantName>\r\n<fundsTransferId>123467</fundsTransferId>\r\n<amount>106</amount>\r\n<accountInfo>\r\n<accType>Checking</accType>\r\n<accNum>12345657890</accNum>\r\n<routingNum>123456789</routingNum>\r\n<checkNum>123455</checkNum></accountInfo>\r\n<customIdentifier>abc123</customIdentifier>\r\n</submerchantDebit>",
                            submerchantDebit.Serialize());

            mockCnpFile.Verify(cnpFile => cnpFile.createRandomFile(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), mockCnpTime.Object));
            mockCnpFile.Verify(cnpFile => cnpFile.AppendLineToFile(mockFilePath, submerchantDebit.Serialize()));
        }
        public void testAddSubmerchantDebit()
        {
            var submerchantDebit = new submerchantDebit();

            submerchantDebit.fundingSubmerchantId = "123456";
            submerchantDebit.submerchantName      = "merchant";
            submerchantDebit.fundsTransferId      = "123467";
            submerchantDebit.amount = 106L;
            var echeck = new echeckType();

            echeck.accType               = echeckAccountTypeEnum.Checking;
            echeck.accNum                = "12345657890";
            echeck.routingNum            = "123456789";
            echeck.checkNum              = "123455";
            submerchantDebit.accountInfo = echeck;

            batchRequest.addSubmerchantDebit(submerchantDebit);

            Assert.AreEqual(1, batchRequest.getNumSubmerchantDebit());
            Assert.AreEqual(106L, batchRequest.getSubmerchantDebitAmount());

            mockLitleFile.Verify(
                litleFile =>
                litleFile.createRandomFile(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(),
                                           mockLitleTime.Object));
            mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(mockFilePath, submerchantDebit.Serialize()));
        }
        public void testAddSubmerchantDebit()
        {
            var submerchantDebit = new submerchantDebit();
            submerchantDebit.fundingSubmerchantId = "123456";
            submerchantDebit.submerchantName = "merchant";
            submerchantDebit.fundsTransferId = "123467";
            submerchantDebit.amount = 106L;
            var echeck = new echeckType();
            echeck.accType = echeckAccountTypeEnum.Checking;
            echeck.accNum = "12345657890";
            echeck.routingNum = "123456789";
            echeck.checkNum = "123455";
            submerchantDebit.accountInfo = echeck;

            batchRequest.addSubmerchantDebit(submerchantDebit);

            Assert.AreEqual(1, batchRequest.getNumSubmerchantDebit());
            Assert.AreEqual(106L, batchRequest.getSubmerchantDebitAmount());

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