twu.setSunriseTime(new DateTime(2013, 11, 20, 5, 0));
twu.setSunsetTime(new DateTime(2013, 11, 20, 17, 0));
DateTime noon = new DateTime(2013, 11, 21, 12, 0);
System.out.print(twu.getSunriseTime().toString() +" - "+ twu.getSunsetTime() +" - "+ noon);
GenericEvent twAtNoon = twu.prepareEvent(noon);
Assert.assertEquals("300", twAtNoon.getProperty("beforeSunset"));
Assert.assertEquals("", twAtNoon.getProperty("afterSunset"));
Assert.assertEquals("", twAtNoon.getProperty("isSunset"));
Assert.assertEquals("", twAtNoon.getProperty("isSunrise"));
Assert.assertEquals("420", twAtNoon.getProperty("afterSunrise"));
Assert.assertEquals("", twAtNoon.getProperty("beforeSunrise"));
noon = new DateTime(2013, 11, 21, 12, 1);
System.out.print(twu.getSunriseTime().toString() +" - "+ twu.getSunsetTime() +" - "+ noon);
twAtNoon = twu.prepareEvent(noon);
Assert.assertEquals("299", twAtNoon.getProperty("beforeSunset"));
Assert.assertEquals("", twAtNoon.getProperty("afterSunset"));
Assert.assertEquals("", twAtNoon.getProperty("isSunset"));
Assert.assertEquals("", twAtNoon.getProperty("isSunrise"));
Assert.assertEquals("421", twAtNoon.getProperty("afterSunrise"));
Assert.assertEquals("", twAtNoon.getProperty("beforeSunrise"));
}