use of org.mifos.accounts.savings.interest.schedule.internal.MonthlyOnLastDayOfMonthInterestScheduledEvent in project head by mifos.
the class MonthlyOnLastDayOfMonthInterestScheduledEventTest method shouldReturnDateWithLastDayOfMonthOneMonthFromJan.
@Test
public void shouldReturnDateWithLastDayOfMonthOneMonthFromJan() {
// setup
int every = 1;
monthlyEvent = new MonthlyOnLastDayOfMonthInterestScheduledEvent(every);
// exercise test
LocalDate nextValidMatchingDate = monthlyEvent.nextMatchingDateFromAlreadyMatchingDate(jan31st);
assertThat(nextValidMatchingDate, is(feb28th));
}
use of org.mifos.accounts.savings.interest.schedule.internal.MonthlyOnLastDayOfMonthInterestScheduledEvent in project head by mifos.
the class MonthlyOnLastDayOfMonthInterestScheduledEventTest method shouldReturnFirstDateOfPeriodOfMatchingMonthlyDate.
@Test
public void shouldReturnFirstDateOfPeriodOfMatchingMonthlyDate() {
// setup
int every = 1;
monthlyEvent = new MonthlyOnLastDayOfMonthInterestScheduledEvent(every);
// exercise test
LocalDate nextValidMatchingDate = monthlyEvent.findFirstDateOfPeriodForMatchingDate(jun30th);
assertThat(nextValidMatchingDate, is(jun1st));
}
use of org.mifos.accounts.savings.interest.schedule.internal.MonthlyOnLastDayOfMonthInterestScheduledEvent in project head by mifos.
the class MonthlyOnLastDayOfMonthInterestScheduledEventTest method shouldReturnFirstDateOfPeriodOfMatchingBiMonthlyDate.
@Test
public void shouldReturnFirstDateOfPeriodOfMatchingBiMonthlyDate() {
// setup
int every = 2;
monthlyEvent = new MonthlyOnLastDayOfMonthInterestScheduledEvent(every);
// exercise test
LocalDate nextValidMatchingDate = monthlyEvent.findFirstDateOfPeriodForMatchingDate(feb28th);
assertThat(nextValidMatchingDate, is(jan1st));
}
use of org.mifos.accounts.savings.interest.schedule.internal.MonthlyOnLastDayOfMonthInterestScheduledEvent in project head by mifos.
the class MonthlyOnLastDayOfMonthInterestScheduledEventTest method shouldReturnTrueForAnyMatchingDate.
@Test
public void shouldReturnTrueForAnyMatchingDate() {
// setup
int every = 2;
monthlyEvent = new MonthlyOnLastDayOfMonthInterestScheduledEvent(every);
// exercise test
boolean isMatch = monthlyEvent.isAMatchingDate(jan1st, apr30);
assertTrue(isMatch);
}
use of org.mifos.accounts.savings.interest.schedule.internal.MonthlyOnLastDayOfMonthInterestScheduledEvent in project head by mifos.
the class MonthlyOnLastDayOfMonthInterestScheduledEventTest method shouldFindNearestMatchingDateAfterOrOnALegalEndOfMonthDate.
@Test
public void shouldFindNearestMatchingDateAfterOrOnALegalEndOfMonthDate() {
// setup
int every = 1;
monthlyEvent = new MonthlyOnLastDayOfMonthInterestScheduledEvent(every);
// exercise test
LocalDate nextMatchingDate = monthlyEvent.nextMatchingDateAfter(jan1st, jan31st);
assertThat(nextMatchingDate, is(jan31st));
}
Aggregations