@Test
public void testIsTherapyActive()
{

  //1.10.2013 is TUESDAY
  final List<String> daysOfWeek = new ArrayList<>();
  daysOfWeek.add("TUESDAY");
  daysOfWeek.add("WEDNESDAY");
  //test start day on active day of week
  assertTrue(
      medicationsBo.isTherapyActive(
          daysOfWeek,
          null,
          Intervals.infiniteFrom(new DateTime(2013, 10, 1, 10, 0, 0)),
          new DateTime(2013, 10, 1, 11, 0, 0))
  );
  //test some day on active day of week
  assertTrue(
      medicationsBo.isTherapyActive(
          daysOfWeek,
          null,
          Intervals.infiniteFrom(new DateTime(2013, 10, 1, 10, 0, 0)),
          new DateTime(2013, 10, 2, 11, 0, 0))
  );
  //test some day on inactive day of week
  assertFalse(
      medicationsBo.isTherapyActive(
          daysOfWeek,
          null,
          Intervals.infiniteFrom(new DateTime(2013, 10, 1, 10, 0, 0)),
          new DateTime(2013, 10, 3, 11, 0, 0))
  );
  //test therapy finished
  assertFalse(
      medicationsBo.isTherapyActive(
          daysOfWeek,
          null,
          new Interval(new DateTime(2013, 5, 1, 10, 0, 0), new DateTime(2013, 10, 1, 10, 0, 0)),
          new DateTime(2013, 10, 2, 11, 0, 0))
  );
  //test therapy not started yet
  assertFalse(
      medicationsBo.isTherapyActive(
          daysOfWeek,
          null,
          Intervals.infiniteFrom(new DateTime(2013, 10, 2, 10, 0, 0)),
          new DateTime(2013, 10, 1, 11, 0, 0))
  );
  //test every second day on start day
  assertTrue(
      medicationsBo.isTherapyActive(
          null,
          2,
          Intervals.infiniteFrom(new DateTime(2013, 10, 1, 10, 0, 0)),
          new DateTime(2013, 10, 1, 11, 0, 0))
  );
  //test every second day on inactive day
  assertFalse(
      medicationsBo.isTherapyActive(
          null,
          2,
          Intervals.infiniteFrom(new DateTime(2013, 10, 1, 10, 0, 0)),
          new DateTime(2013, 10, 2, 11, 0, 0))
  );
  //test every second day on active day
  assertTrue(
      medicationsBo.isTherapyActive(
          null,
          2,
          Intervals.infiniteFrom(new DateTime(2013, 10, 1, 10, 0, 0)),
          new DateTime(2013, 10, 3, 11, 0, 0))
  );
  //test every fifth day on active day
  assertTrue(
      medicationsBo.isTherapyActive(
          null,
          5,
          Intervals.infiniteFrom(new DateTime(2013, 10, 1, 10, 0, 0)),
          new DateTime(2013, 10, 6, 11, 0, 0))
  );
  //test every fifth day on inactive day
  assertFalse(
      medicationsBo.isTherapyActive(
          null,
          5,
          Intervals.infiniteFrom(new DateTime(2013, 1, 10, 10, 0, 0)),
          new DateTime(2013, 1, 5, 11, 0, 0))
  );
}