/// <summary> /// /// </summary> /// <param name="divArray"></param> /// <returns></returns> public static DividendList UnpackDiv(List <DividendRange> divArray) { //map in the dividend curve var dList = new DividendList(); foreach (DividendRange divRange in divArray) { DateTime date = divRange.DivDate; var dividend = new Dividend(date, date, divRange.DivAmt, "AUD"); dList.Add(dividend); } return(dList); }
/// <summary> /// Creates the dividend list. /// </summary> /// <param name="exDivDate">The ex div date.</param> /// <param name="paymentDate">The payment date.</param> /// <param name="paymentAmt">The payment amt.</param> /// <param name="currencyCode">The currency code.</param> /// <returns></returns> static public DividendList CreateDividendList(List <Dividend> dividends) { DividendList dividendList = new DividendList(); foreach (Dividend div in dividends) { dividendList.Add(div); } Assert.AreEqual(dividendList.Dividends.Length, dividends.Count); Assert.AreEqual(dividendList.ExDivDates.Length, dividends.Count); Assert.AreEqual(dividendList.PaymentAmountsInCents.Length, dividends.Count); Assert.AreEqual(dividendList.PaymentDates.Length, dividends.Count); return(dividendList); }