use of org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment in project head by mifos.
the class InstallmentFormatValidatorTest method shouldValidateVariableInstallmentScheduleForValidDueDate.
@Test
public void shouldValidateVariableInstallmentScheduleForValidDueDate() {
RepaymentScheduleInstallment installment = installmentBuilder.withInstallment(3).withDueDate("30-Nov-2010").withPrincipal(new Money(rupeeCurrency, "499.9")).withInterest(new Money(rupeeCurrency, "22.1")).withFees(new Money(rupeeCurrency, "0.0")).withTotal("522.0").build();
List<ErrorEntry> errorEntries = installmentFormatValidator.validateDueDateFormat(installment);
assertThat(errorEntries.isEmpty(), is(true));
}
use of org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment in project head by mifos.
the class InstallmentFormatValidatorTest method shouldValidateVariableInstallmentScheduleForDueDateInvalidContent.
@Test
public void shouldValidateVariableInstallmentScheduleForDueDateInvalidContent() {
RepaymentScheduleInstallment installment = installmentBuilder.withInstallment(3).withDueDate("31-Nov-2010").withPrincipal(new Money(rupeeCurrency, "499.9")).withInterest(new Money(rupeeCurrency, "22.1")).withFees(new Money(rupeeCurrency, "0.0")).withTotal("522.0").build();
assertForValidDueDate(installment, "3");
}
use of org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment in project head by mifos.
the class InstallmentFormatValidatorTest method shouldNotValidateInstallmentScheduleForTotalAmountLessThanZero.
@Test
public void shouldNotValidateInstallmentScheduleForTotalAmountLessThanZero() {
RepaymentScheduleInstallment installment = installmentBuilder.withInstallment(3).withDueDate("30-Nov-2010").withPrincipal(new Money(rupeeCurrency, "499.9")).withInterest(new Money(rupeeCurrency, "22.1")).withFees(new Money(rupeeCurrency, "0.0")).withTotal("-499.9").build();
List<ErrorEntry> errorEntries = installmentFormatValidator.validateTotalAmountFormat(installment);
assertThat(errorEntries.isEmpty(), is(true));
}
use of org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment in project head by mifos.
the class InstallmentFormatValidatorTest method shouldNotValidateInstallmentScheduleForValidTotalAmount.
@Test
public void shouldNotValidateInstallmentScheduleForValidTotalAmount() {
RepaymentScheduleInstallment installment = installmentBuilder.withInstallment(3).withDueDate("30-Nov-2010").withPrincipal(new Money(rupeeCurrency, "499.9")).withInterest(new Money(rupeeCurrency, "22.1")).withFees(new Money(rupeeCurrency, "0.0")).withTotal("499.9").build();
List<ErrorEntry> errorEntries = installmentFormatValidator.validateTotalAmountFormat(installment);
assertThat(errorEntries.isEmpty(), is(true));
}
use of org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment in project head by mifos.
the class InstallmentFormatValidatorTest method shouldValidateInstallmentScheduleForInvalidTotalAmount.
@Test
public void shouldValidateInstallmentScheduleForInvalidTotalAmount() {
RepaymentScheduleInstallment installment = installmentBuilder.withInstallment(3).withDueDate("30-Nov-2010").withPrincipal(new Money(rupeeCurrency, "499.9")).withInterest(new Money(rupeeCurrency, "22.1")).withFees(new Money(rupeeCurrency, "0.0")).withTotal("abcd").build();
assertForValidTotalAmount(installment, "3");
}
Aggregations