Search in sources :

Example 11 with DailyInterestScheduledEvent

use of org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent in project head by mifos.

the class DailyInterestScheduledEventTest method shouldReturnTrueForAnyMatchingDate.

@Test
public void shouldReturnTrueForAnyMatchingDate() {
    // setup
    int every = 2;
    dailyEvent = new DailyInterestScheduledEvent(every);
    // exercise test
    boolean isMatch = dailyEvent.isAMatchingDate(jan1st, jan2nd);
    assertTrue(isMatch);
}
Also used : DailyInterestScheduledEvent(org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent) Test(org.junit.Test)

Example 12 with DailyInterestScheduledEvent

use of org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent in project head by mifos.

the class DailyInterestScheduledEventTest method shouldReturnFirstDateOfPeriodOfMatchingDailyDate.

@Test
public void shouldReturnFirstDateOfPeriodOfMatchingDailyDate() {
    // setup
    int every = 1;
    dailyEvent = new DailyInterestScheduledEvent(every);
    // exercise test
    LocalDate nextValidMatchingDate = dailyEvent.findFirstDateOfPeriodForMatchingDate(jan1st);
    assertThat(nextValidMatchingDate, is(jan1st));
}
Also used : LocalDate(org.joda.time.LocalDate) DailyInterestScheduledEvent(org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent) Test(org.junit.Test)

Example 13 with DailyInterestScheduledEvent

use of org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent in project head by mifos.

the class DailyInterestScheduledEventTest method shouldFindNearestMatchingDateAfterAnyGivenDate.

@Test
public void shouldFindNearestMatchingDateAfterAnyGivenDate() {
    // setup
    int every = 1;
    dailyEvent = new DailyInterestScheduledEvent(every);
    // exercise test
    LocalDate nextMatchingDate = dailyEvent.nextMatchingDateAfter(jan1st, jan3rd);
    assertThat(nextMatchingDate, is(jan4th));
}
Also used : LocalDate(org.joda.time.LocalDate) DailyInterestScheduledEvent(org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)13 DailyInterestScheduledEvent (org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent)13 LocalDate (org.joda.time.LocalDate)10 InterestScheduledEvent (org.mifos.accounts.savings.interest.schedule.InterestScheduledEvent)1 MonthlyOnLastDayOfMonthInterestScheduledEvent (org.mifos.accounts.savings.interest.schedule.internal.MonthlyOnLastDayOfMonthInterestScheduledEvent)1