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); }
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); }