use of org.joda.time.LocalDate 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.joda.time.LocalDate 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.joda.time.LocalDate 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.joda.time.LocalDate 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.joda.time.LocalDate in project head by mifos.
the class DailyInterestScheduledEventTest method shouldReturnAllMatchingDailyDatesStartingFromFiscalStartDateUpToCutOffDate.
@Test
public void shouldReturnAllMatchingDailyDatesStartingFromFiscalStartDateUpToCutOffDate() {
// setup
int every = 1;
dailyEvent = new DailyInterestScheduledEvent(every);
// exercise test
List<LocalDate> nextValidMatchingDate = dailyEvent.findAllMatchingDatesFromBaseDateUpToAndIncludingNearestMatchingEndDate(startOfFiscalYear, cutOffDate);
assertThat(nextValidMatchingDate, hasItem(jan1st));
assertThat(nextValidMatchingDate, hasItem(jan2nd));
assertThat(nextValidMatchingDate, hasItem(jan3rd));
assertThat(nextValidMatchingDate, hasItem(dec31st));
}
Aggregations