Search in sources :

Example 1 with MonthlyCashFlowFormMatcher

use of org.mifos.platform.cashflow.matchers.MonthlyCashFlowFormMatcher in project head by mifos.

the class CashFlowFormTest method testGetMonthlyCashFlows.

@Test
public void testGetMonthlyCashFlows() throws Exception {
    MonthlyCashFlowDetail cashFlowDetail1 = new MonthlyCashFlowDetail(new DateTime(), new BigDecimal(12), new BigDecimal(12), "notes");
    MonthlyCashFlowDetail cashFlowDetail2 = new MonthlyCashFlowDetail(new DateTime(), new BigDecimal(23), new BigDecimal(34), "notes");
    ArrayList<MonthlyCashFlowDetail> monthlyCashFlowDetails = new ArrayList<MonthlyCashFlowDetail>();
    monthlyCashFlowDetails.add(cashFlowDetail1);
    monthlyCashFlowDetails.add(cashFlowDetail2);
    CashFlowDetail cashFlowDetail = new CashFlowDetail(monthlyCashFlowDetails);
    CashFlowForm cashFlowForm = new CashFlowForm(cashFlowDetail, false, null, 0d);
    List<MonthlyCashFlowForm> actual = cashFlowForm.getMonthlyCashFlows();
    List<MonthlyCashFlowForm> expected = new ArrayList<MonthlyCashFlowForm>();
    expected.add(new MonthlyCashFlowForm(cashFlowDetail1));
    expected.add(new MonthlyCashFlowForm(cashFlowDetail2));
    assertThat(actual.get(0), new MonthlyCashFlowFormMatcher(expected.get(0)));
    assertThat(actual.get(1), new MonthlyCashFlowFormMatcher(expected.get(1)));
}
Also used : MonthlyCashFlowFormMatcher(org.mifos.platform.cashflow.matchers.MonthlyCashFlowFormMatcher) MonthlyCashFlowDetail(org.mifos.platform.cashflow.service.MonthlyCashFlowDetail) CashFlowDetail(org.mifos.platform.cashflow.service.CashFlowDetail) ArrayList(java.util.ArrayList) MonthlyCashFlowDetail(org.mifos.platform.cashflow.service.MonthlyCashFlowDetail) DateTime(org.joda.time.DateTime) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Aggregations

BigDecimal (java.math.BigDecimal)1 ArrayList (java.util.ArrayList)1 DateTime (org.joda.time.DateTime)1 Test (org.junit.Test)1 MonthlyCashFlowFormMatcher (org.mifos.platform.cashflow.matchers.MonthlyCashFlowFormMatcher)1 CashFlowDetail (org.mifos.platform.cashflow.service.CashFlowDetail)1 MonthlyCashFlowDetail (org.mifos.platform.cashflow.service.MonthlyCashFlowDetail)1