예제 #1
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));
 }
예제 #2
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));
 }
예제 #3
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);
 }