FundraisingController instance = new FundraisingController();
instance.addFundraisingsPlan(year, month, plan);
Fundraising result = instance.read(year);
assertEquals(2, result.getFundraisingPlans().size());
for (FundraisingPlan item: result.getFundraisingPlans()) {
assertEquals(month, item.getMonthSelected());
assertTrue(item.getMonthFunding() > 0);
assertTrue(item.getAmount().compareTo(new BigDecimal(99.99)) > 0);
}
plan = new FundraisingPlan[3];
plan[0] = result.getFundraisingPlans().get(0);
p2 = new FundraisingPlan();
p2.setMonthSelected(month);
p2.setMonthFunding(2);
p2.setAmount(new BigDecimal(2500));
plan[1] = p2;
FundraisingPlan p3 = new FundraisingPlan();
p3.setMonthSelected(month);
p3.setMonthFunding(2);
p3.setAmount(new BigDecimal(1500));
plan[2] = p3;
instance.addFundraisingsPlan(year, month, plan);
result = instance.read(year);
assertEquals(3, result.getFundraisingPlans().size());
for (FundraisingPlan item: result.getFundraisingPlans()) {
assertEquals(month, item.getMonthSelected());
assertTrue(item.getMonthFunding() > 0);
assertTrue(item.getAmount().compareTo(new BigDecimal(99.99)) > 0);
}