* @version $Revision$
*/
public class EventDateTimeUtilsTest {
@Test
public void testFindAcademicTerms() {
final AcademicTermDetailImpl spring2012 = new AcademicTermDetailImpl(new DateMidnight(2012, 1, 1), new DateMidnight(2012, 6, 1), "Spring 2012");
final AcademicTermDetailImpl summer2012 = new AcademicTermDetailImpl(new DateMidnight(2012, 6, 1), new DateMidnight(2012, 9, 1), "Summer 2012");
final AcademicTermDetailImpl fall2012 = new AcademicTermDetailImpl(new DateMidnight(2012, 9, 1), new DateMidnight(2013, 1, 1), "Fall 2012");
List<AcademicTermDetailImpl> terms = Arrays.asList(
spring2012,
summer2012,
fall2012
);
AcademicTermDetailImpl result;
Collections.sort(terms);
result = EventDateTimeUtils.findDateRangeSorted(new DateMidnight(2011, 3, 1), terms);
assertNull(result);
result = EventDateTimeUtils.findDateRangeSorted(new DateMidnight(2012, 3, 1), terms);
assertEquals(spring2012, result);
result = EventDateTimeUtils.findDateRangeSorted(new DateMidnight(2012, 7, 1), terms);
assertEquals(summer2012, result);
result = EventDateTimeUtils.findDateRangeSorted(new DateMidnight(2012, 12, 31), terms);
assertEquals(fall2012, result);
}