use of org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent in project head by mifos.
the class DailyInterestScheduledEventTest method shouldReturnFirstDateOfPeriodOfMatchingBiDailyDate.
@Test
public void shouldReturnFirstDateOfPeriodOfMatchingBiDailyDate() {
// setup
int every = 2;
dailyEvent = new DailyInterestScheduledEvent(every);
// exercise test
LocalDate nextValidMatchingDate = dailyEvent.findFirstDateOfPeriodForMatchingDate(jan2nd);
assertThat(nextValidMatchingDate, is(jan1st));
}
use of org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent in project head by mifos.
the class DailyInterestScheduledEventTest method shouldFindNearestMatchingDateAfterALegalDailyDate.
@Test
public void shouldFindNearestMatchingDateAfterALegalDailyDate() {
// setup
int every = 1;
dailyEvent = new DailyInterestScheduledEvent(every);
// exercise test
LocalDate nextMatchingDate = dailyEvent.nextMatchingDateAfter(jan1st, jan2nd);
assertThat(nextMatchingDate, is(jan3rd));
}
use of org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent in project head by mifos.
the class DailyInterestScheduledEventTest method shouldReturnDateOneDayAheadOfJan1st.
@Test
public void shouldReturnDateOneDayAheadOfJan1st() {
// setup
int every = 1;
dailyEvent = new DailyInterestScheduledEvent(every);
// exercise test
LocalDate nextValidMatchingDate = dailyEvent.nextMatchingDateFromAlreadyMatchingDate(jan1st);
assertThat(nextValidMatchingDate, is(jan2nd));
}
use of org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent in project head by mifos.
the class DailyInterestScheduledEventTest method shouldReturnAllMatchingBiDailyDatesStartingFromFiscalStartDateUpToCutOffDate.
@Test
public void shouldReturnAllMatchingBiDailyDatesStartingFromFiscalStartDateUpToCutOffDate() {
// setup
int every = 2;
dailyEvent = new DailyInterestScheduledEvent(every);
// exercise test
List<LocalDate> nextValidMatchingDate = dailyEvent.findAllMatchingDatesFromBaseDateUpToAndIncludingNearestMatchingEndDate(startOfFiscalYear, cutOffDate);
assertThat(nextValidMatchingDate, hasItem(jan2nd));
assertThat(nextValidMatchingDate, hasItem(jan4th));
assertThat(nextValidMatchingDate, not(hasItem(jan1st)));
assertThat(nextValidMatchingDate, not(hasItem(jan3rd)));
}
use of org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent in project head by mifos.
the class DailyInterestScheduledEventTest method shouldReturnTrueForMatchingDate.
@Test
public void shouldReturnTrueForMatchingDate() {
// setup
int every = 1;
dailyEvent = new DailyInterestScheduledEvent(every);
// exercise test
boolean isMatch = dailyEvent.isAMatchingDate(jan1st, jan2nd);
assertTrue(isMatch);
}
Aggregations