Exemple #1
0
        public void Load_WithDuplicateBills_ThrowsGatewayException()
        {
            Assert.ThrowsException <GatewayException>(() => {
                var service = new BillPayService();
                var bills   = new List <Bill>()
                {
                    billLoad,
                    billLoad
                };

                service.LoadBills(bills, "billload");
            });
        }
Exemple #2
0
        public void Load_WithOneBill_DoesNotThrow()
        {
            try {
                var service = new BillPayService();

                service.LoadBills(new List <Bill>()
                {
                    billLoad
                }, "billload");
            } catch (Exception ex) {
                Assert.Fail(ex.Message);
            }
        }
Exemple #3
0
        public void Load_WithFiveThousandBills_DoesNotThrow()
        {
            try {
                var service = new BillPayService();

                service.LoadBills(Enumerable.Range(0, 5000).Select(x => new Bill()
                {
                    Amount          = billLoad.Amount,
                    BillPresentment = billLoad.BillPresentment,
                    BillType        = billLoad.BillType,
                    Customer        = billLoad.Customer,
                    DueDate         = billLoad.DueDate,
                    Identifier1     = x.ToString(),
                    Identifier2     = x.ToString()
                }), "billload");
            } catch (Exception ex) {
                Assert.Fail(ex.Message);
            }
        }
Exemple #4
0
        public void Load_WithInvalidBillType_ThrowsGatewayException()
        {
            Assert.ThrowsException <GatewayException>(() => {
                var service = new BillPayService();
                var bills   = new List <Bill>()
                {
                    billLoad,
                    new Bill()
                    {
                        Amount          = billLoad.Amount,
                        BillPresentment = billLoad.BillPresentment,
                        BillType        = "InvalidBillType",
                        Customer        = billLoad.Customer,
                        DueDate         = billLoad.DueDate,
                        Identifier1     = billLoad.Identifier1
                    }
                };

                service.LoadBills(bills, "billload");
            });
        }