コード例 #1
0
ファイル: LoanCalTest1.cs プロジェクト: akelkar3/LoanCal
        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);
        }
コード例 #2
0
ファイル: LoanCalTest1.cs プロジェクト: akelkar3/LoanCal
        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);
        }