@Test public void trigger_isDisabled_nameNotEmpty_dateNotEmpty_ReturnsFalse() { Trigger trigger = new Trigger(); trigger.setName("name"); trigger.setRawDate("date"); assertFalse(trigger.isDisabled()); }
@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"); }
@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)); }