public static void Round(IRounder <TValue> rounder, TValue value, TValue etalonRoundValue) { TValue previousValue = value; TValue roundValue = rounder.Round(value); Assert.AreEqual <TValue>(etalonRoundValue, roundValue); Assert.AreEqual <TValue>(previousValue, value); }
public RePayment(int number, decimal amountDue, decimal principal, decimal interest, [CanBeNull] IRounder rounder = null) { _rounder = rounder; Number = number; _amountDue = amountDue; _principal = principal; _interest = interest; _rounder = rounder ?? new DefaultRounder(); }
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(); }
public SegmentRoundDouble(ISegment <double, double> segment, IRounder <double> rounder) : base(segment, rounder) { }
public SegmentWithRound(ISegment <TLabel, TSpan> segment, IRounder <TLabel> rounder) { _segmentOriginal = segment; Rounder = rounder; }