use of org.mifos.domain.builders.ScheduledEventBuilder in project head by mifos.
the class FeeInstallmentTest method createMergedFeeInstallmentsForOneFeeBothAccountAndFeeAreScheduledEveryWeekShouldGetOneFeeInstallmentPerAccountEvent.
@Test
public void createMergedFeeInstallmentsForOneFeeBothAccountAndFeeAreScheduledEveryWeekShouldGetOneFeeInstallmentPerAccountEvent() {
ScheduledEvent masterEvent = new ScheduledEventBuilder().every(1).weeks().build();
FeeBO feeBO = createWeeklyFeeBO(1);
AccountFeesEntity accountFeesEntity = createAccountFeesEntity(feeBO, 10.0);
List<FeeInstallment> feeInstallments = FeeInstallment.createMergedFeeInstallmentsForOneFee(masterEvent, accountFeesEntity, 3);
assertThat(feeInstallments.size(), is(3));
assertFeeInstallment(feeInstallments.get(0), 1, 10.0, feeBO);
assertFeeInstallment(feeInstallments.get(1), 2, 10.0, feeBO);
assertFeeInstallment(feeInstallments.get(2), 3, 10.0, feeBO);
}
use of org.mifos.domain.builders.ScheduledEventBuilder in project head by mifos.
the class FeeInstallmentTest method createMergedFeeInstallmentsForOneFeeAccountScheduledEveryWeekFeeScheduledEveryOtherWeekShouldGetOneFeeInstallmentPerEveryOtherAccountEvent.
@Test
public void createMergedFeeInstallmentsForOneFeeAccountScheduledEveryWeekFeeScheduledEveryOtherWeekShouldGetOneFeeInstallmentPerEveryOtherAccountEvent() {
ScheduledEvent accountEvent = new ScheduledEventBuilder().every(1).weeks().build();
FeeBO feeBO = createWeeklyFeeBO(2);
AccountFeesEntity accountFeesEntity = createAccountFeesEntity(feeBO, 10.0);
List<FeeInstallment> feeInstallments = FeeInstallment.createMergedFeeInstallmentsForOneFee(accountEvent, accountFeesEntity, 4);
assertThat(feeInstallments.size(), is(2));
assertFeeInstallment(feeInstallments.get(0), 1, 10.0, feeBO);
assertFeeInstallment(feeInstallments.get(1), 3, 10.0, feeBO);
}
Aggregations