Example #1
0
        public void TestAddCustomerCredit()
        {
            var customerCredit = new customerCredit();

            customerCredit.fundingCustomerId = "123456";
            customerCredit.customerName      = "John Doe";
            customerCredit.fundsTransferId   = "123467";
            customerCredit.amount            = 107L;
            customerCredit.customIdentifier  = "12345678";

            var echeck = new echeckType();

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

            batchRequest.addCustomerCredit(customerCredit);

            Assert.AreEqual(1, batchRequest.getNumCustomerCredit());
            Assert.AreEqual(107L, batchRequest.getCustomerCreditAmount());
            Assert.AreEqual("\r\n<customerCredit reportGroup=\"Default Report Group\">\r\n<fundingCustomerId>123456</fundingCustomerId>\r\n<customerName>John Doe</customerName>\r\n<fundsTransferId>123467</fundsTransferId>\r\n<amount>107</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>12345678</customIdentifier>\r\n</customerCredit>",
                            customerCredit.Serialize());

            mockCnpFile.Verify(cnpFile => cnpFile.createRandomFile(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), mockCnpTime.Object));
            mockCnpFile.Verify(cnpFile => cnpFile.AppendLineToFile(mockFilePath, customerCredit.Serialize()));
        }