public double[] CalculateRealRepayCurve(DateTime pFirstDate, int pForecastDays) { double[] list = new double[pForecastDays]; List <KeyValuePair <DateTime, decimal> > result = _contractManagement.CalculateCashToRepayByDay(pFirstDate, pFirstDate.AddDays(pForecastDays)); for (int i = 0; i < pForecastDays; i++) { OCurrency amount = result.Where(x => x.Key <= pFirstDate.AddDays(i)).Sum(x => x.Value); list[i] = Convert.ToDouble(amount.Value); } return(list); }
public void CalculateCashToRepayByDay_NoResult() { List <KeyValuePair <DateTime, decimal> > list = _loanManager.CalculateCashToRepayByDay(new DateTime(2007, 1, 1), new DateTime(2007, 1, 5)); Assert.AreEqual(0, list.Count); }