public function testWhenEnabledAnInvalidInterval()
 {
     $series = new TestReservationSeries();
     $series->AddEndReminder(new ReservationReminder('abc', ReservationReminderInterval::Days));
     $rule = new ReminderValidationRule();
     $result = $rule->Validate($series);
     $this->assertFalse($result->IsValid());
 }
 public function testAddsReservationReminders()
 {
     $seriesId = 999;
     $reservation = new TestReservationSeries();
     $reservation->WithResource(new FakeBookableResource(837));
     $reservation->AddStartReminder(new ReservationReminder(15, ReservationReminderInterval::Hours));
     $reservation->AddEndReminder(new ReservationReminder(400, ReservationReminderInterval::Minutes));
     $minutesPriorStart = 60 * 15;
     $minutesPriorEnd = 400;
     $this->db->_ExpectedInsertId = $seriesId;
     $this->repository->Add($reservation);
     $insertStartReminder = new AddReservationReminderCommand($seriesId, $minutesPriorStart, ReservationReminderType::Start);
     $insertEndReminder = new AddReservationReminderCommand($seriesId, $minutesPriorEnd, ReservationReminderType::End);
     $this->assertTrue($this->db->ContainsCommand($insertStartReminder));
     $this->assertTrue($this->db->ContainsCommand($insertEndReminder));
 }