Exemplo n.º 1
0
        public void Calculate_ShouldGenerateCorrectCashflowCount()
        {
            List <LoanDetail> testLoan = GetTestLoans();
            var controller             = new LoanCal.Controllers.LoanController();
            var result = controller.Calculate(testLoan) as OkNegotiatedContentResult <List <List <CashFlow> > >;

            Assert.AreEqual((testLoan.Count + 1), result.Content.Count);
        }
Exemplo n.º 2
0
        public void Calculate_ShouldGiveEndingRemainingBalanceZero()
        {
            var  testLoan   = GetTestLoans();
            var  controller = new LoanCal.Controllers.LoanController();
            var  result     = controller.Calculate(testLoan) as OkNegotiatedContentResult <List <List <CashFlow> > >;
            bool test       = true;

            foreach (var item in result.Content)
            {
                if (Convert.ToInt32(item[item.Count - 1].Balance) != 0)
                {
                    test = false;
                }
            }
            Assert.IsTrue(test);
        }