@Test public void testNextPrayer() { DateComponents components = new DateComponents(2015, 9, 1); CalculationParameters parameters = CalculationMethod.KARACHI.getParameters(); parameters.madhab = Madhab.HANAFI; parameters.highLatitudeRule = HighLatitudeRule.TWILIGHT_ANGLE; Coordinates coordinates = new Coordinates(33.720817, 73.090032); PrayerTimes p = new PrayerTimes(coordinates, components, parameters); assertThat(p.nextPrayer(TestUtils.addSeconds(p.fajr, -1))).isEqualTo(Prayer.FAJR); assertThat(p.nextPrayer(p.fajr)).isEqualTo(Prayer.SUNRISE); assertThat(p.nextPrayer(TestUtils.addSeconds(p.fajr, 1))).isEqualTo(Prayer.SUNRISE); assertThat(p.nextPrayer(TestUtils.addSeconds(p.sunrise, 1))).isEqualTo(Prayer.DHUHR); assertThat(p.nextPrayer(TestUtils.addSeconds(p.dhuhr, 1))).isEqualTo(Prayer.ASR); assertThat(p.nextPrayer(TestUtils.addSeconds(p.asr, 1))).isEqualTo(Prayer.MAGHRIB); assertThat(p.nextPrayer(TestUtils.addSeconds(p.maghrib, 1))).isEqualTo(Prayer.ISHA); assertThat(p.nextPrayer(TestUtils.addSeconds(p.isha, 1))).isEqualTo(Prayer.NONE); }
public Prayer nextPrayer() { return nextPrayer(new Date()); }
PrayerTimes { public Prayer nextPrayer() { return nextPrayer(new Date()); } }
PrayerTimes { public Prayer nextPrayer() { return nextPrayer(new Date()); } PrayerTimes(Coordinates coordinates, DateComponents date, CalculationParameters parameters); }
PrayerTimes { public Prayer nextPrayer() { return nextPrayer(new Date()); } PrayerTimes(Coordinates coordinates, DateComponents date, CalculationParameters parameters); Prayer currentPrayer(); Prayer currentPrayer(Date time); Prayer nextPrayer(); Prayer nextPrayer(Date time); Date timeForPrayer(Prayer prayer); }
PrayerTimes { public Prayer nextPrayer() { return nextPrayer(new Date()); } PrayerTimes(Coordinates coordinates, DateComponents date, CalculationParameters parameters); Prayer currentPrayer(); Prayer currentPrayer(Date time); Prayer nextPrayer(); Prayer nextPrayer(Date time); Date timeForPrayer(Prayer prayer); final Date fajr; final Date sunrise; final Date dhuhr; final Date asr; final Date maghrib; final Date isha; }