コード例 #1
0
 @Test
 public void trigger_isDisabled_nameNotEmpty_recurrencesNotEmpty_ReturnsFalse() {
   Trigger trigger = new Trigger();
   trigger.setName("name");
   trigger.setRecurrences("recurrences");
   assertFalse(trigger.isDisabled());
 }
コード例 #2
0
 @Test
 public void trigger_isDisabled_nameNotEmpty_timeNotEmpty_ReturnsFalse() {
   Trigger trigger = new Trigger();
   trigger.setName("name");
   trigger.setRawTime("time");
   assertFalse(trigger.isDisabled());
 }
コード例 #3
0
  @Test
  public void trigger_getFormattedDate_format_ReturnsTrue()
      throws NoSuchFieldException, IllegalAccessException {
    Trigger trigger = new Trigger();

    trigger.setRawDate("2015-06-03T15:36:14.400558Z");
    assertEquals(trigger.getFormattedDate(), "Jun 3 2015");
  }
コード例 #4
0
  @Test
  public void trigger_getFormattedTime_format_ReturnsTrue()
      throws NoSuchFieldException, IllegalAccessException {
    Trigger trigger = new Trigger();

    trigger.setRawTime("07:00:00");
    assertEquals(trigger.getFormattedTime(), "7:00 AM");
  }
コード例 #5
0
 @Test
 public void trigger_setter_id_ReturnsTrue() throws NoSuchFieldException, IllegalAccessException {
   Trigger trigger = new Trigger();
   int value = (int) Math.random();
   trigger.setId(value);
   final Field field = trigger.getClass().getDeclaredField("id");
   field.setAccessible(true);
   assertEquals(value, field.get(trigger));
 }
コード例 #6
0
 @Test
 public void trigger_setter_date_ReturnsTrue()
     throws NoSuchFieldException, IllegalAccessException {
   Trigger trigger = new Trigger();
   String value = new String("trigger_date");
   trigger.setRawDate(value);
   final Field field = trigger.getClass().getDeclaredField("trigger_date");
   field.setAccessible(true);
   assertEquals(value, field.get(trigger));
 }
コード例 #7
0
 @Test
 public void trigger_getter_recurrences_time_ReturnsTrue()
     throws NoSuchFieldException, IllegalAccessException {
   Trigger trigger = new Trigger();
   String value = new String("time");
   final Field field = trigger.getClass().getDeclaredField("time");
   field.setAccessible(true);
   field.set(trigger, value);
   final String result = trigger.getRawTime();
   assertEquals(value, result);
 }
コード例 #8
0
 @Test
 public void trigger_getFormattedTime_empty_ReturnsTrue() {
   Trigger trigger = new Trigger();
   assertEquals(trigger.getFormattedTime(), "");
 }
コード例 #9
0
 @Test
 public void trigger_isDisabled_nameNotEmpty_ReturnsTrue() {
   Trigger trigger = new Trigger();
   trigger.setName("name");
   assertTrue(trigger.isDisabled());
 }
コード例 #10
0
 @Test
 public void trigger_getRRULE_recurrencesNotEmpty_ReturnsTrue() {
   Trigger trigger = new Trigger();
   trigger.setRecurrences("RRULE:FREQ=DAILY");
   assertEquals(trigger.getRRULE(), "FREQ=DAILY");
 }
コード例 #11
0
 @Test
 public void trigger_getRRULE_recurrencesEmpty_ReturnsTrue() {
   Trigger trigger = new Trigger();
   assertEquals(trigger.getRRULE(), "");
 }
コード例 #12
0
 @Test
 public void trigger_isDisabled_nameEmpty_ReturnsFalse() {
   Trigger trigger = new Trigger();
   assertFalse(trigger.isDisabled());
 }