Esempio n. 1
0
        public void GetOverDueTest(string dueDateString)
        {
            var dueDate  = DateTime.Parse(dueDateString);
            var result   = installmentService.GetOverDue(dueDate);
            var expected = (DateTime.Today - dueDate).Days;

            Assert.Equal(expected, result);
        }
Esempio n. 2
0
        public DebtDtoResponse MountDebtDtoResponse(Debt debt)
        {
            var newDebt = new DebtDtoResponse();

            newDebt.Number            = debt.Number;
            newDebt.DebtorName        = debt.DebtorName;
            newDebt.TotalInstallments = debt.Installments.Count;
            newDebt.OriginalValue     = debt.Installments.Sum(x => x.Value);
            newDebt.OverDue           = _installmentService.GetOverDue(debt.Installments.First().DueDate);
            newDebt.UpdatedValue      = _installmentService.GetUpdatedValue(debt.Installments, debt.PenaltyPercent, debt.InterestPercent);

            return(newDebt);
        }