コード例 #1
0
        public Loan(decimal netAmount, int totalPaymentsCount, /* LoanPeriodType periodType,*/ double annualInterestRate, [CanBeNull] IRounder rounder = null)
        {
            Verifiers.ArgVerify(netAmount > 0, "The amount of the loan can't be less or equal to 0", nameof(netAmount));
            Verifiers.ArgVerify(totalPaymentsCount > 0, "The number of payments over the life of the loan can't be less or equal to 0", nameof(netAmount));
            Verifiers.ArgVerify(annualInterestRate > 0, "(The Annual Percentage Rate can't be less or equal to 0", nameof(netAmount));

            _netAmount         = netAmount;
            TotalPaymentsCount = totalPaymentsCount;
            //_periodType = periodType;
            InterestRate = annualInterestRate / 100 / TotalPaymentsCount;

            _rounder = rounder ?? new DefaultRounder();
        }