Ejemplo n.º 1
0
        public void Test_MoneyHelper_4()
        {
            // need to be able to use DI to work with this object

            DMPFeeService service = new DMPFeeService();

            DMPFeeRequestViewModel req = new DMPFeeRequestViewModel()
            {
                CustomerFirstname = "Cam",
                CustomerSurname   = "Braidwood",
                CustomerDebtManagementCompanyId = DebtServiceProviderEnumerator.MoneyHelper.ToString(),
                Income           = 1000,
                Expenses         = 800,
                Debt1Desctiption = "loan",
                Debt1Value       = 1000,
                Debt2Desctiption = "loan 2",
                Debt2Value       = 1000
            };

            DMPFeeResultModel result = service.Calculate(req);

            Assert.AreEqual(result.OK, true);
            Assert.AreEqual(result.DMPResponse.Fee, 20);
            Assert.AreEqual(result.DMPResponse.DebtRepaymentList.Count, 2);
            Assert.AreEqual(result.DMPResponse.DebtRepaymentList[0].DebtMonthlyRepayment, 90m);
            Assert.AreEqual(result.DMPResponse.DebtRepaymentList[1].DebtMonthlyRepayment, 90m);
        }
        public void Test_DebtDestructor_5()
        {
            DMPFeeService service = new DMPFeeService();
            //IDMPFeeService service = ObjectFactory.GetInstance<IDMPFeeService>();

            //HomeController c = new HomeController(service);

            DMPFeeRequestViewModel req = new DMPFeeRequestViewModel()
            {
                CustomerFirstname = "Cam",
                CustomerSurname   = "Braidwood",
                CustomerDebtManagementCompanyId = DebtServiceProviderEnumerator.DebtDestructor.ToString(),
                Income           = 1000,
                Expenses         = 810,
                Debt1Desctiption = "loan",
                Debt1Value       = 1000,
                Debt2Desctiption = "loan 2",
                Debt2Value       = 1000
            };

            DMPFeeResultModel result = service.Calculate(req);

            Assert.AreEqual(result.OK, true);
            Assert.AreEqual(result.DMPResponse.Fee, 30);
            Assert.AreEqual(result.DMPResponse.DebtRepaymentList.Count, 2);
            Assert.AreEqual(result.DMPResponse.DebtRepaymentList[0].DebtMonthlyRepayment, 80);
            Assert.AreEqual(result.DMPResponse.DebtRepaymentList[1].DebtMonthlyRepayment, 80);
        }
        public void Test_McDermottGodfrey_2()
        {
            // need to be able to use DI to work with this object

            DMPFeeService service = new DMPFeeService();

            DMPFeeRequestViewModel req = new DMPFeeRequestViewModel()
            {
                CustomerFirstname = "Cam",
                CustomerSurname   = "Braidwood",
                CustomerDebtManagementCompanyId = DebtServiceProviderEnumerator.McDermottGodfrey.ToString(),
                Income           = 1000,
                Expenses         = 1300,
                Debt1Desctiption = "loan",
                Debt1Value       = 5000
            };

            DMPFeeResultModel result = service.Calculate(req);

            Assert.AreEqual(result.OK, true);
            Assert.AreEqual(result.DMPResponse.Fee, 0);
        }