public void testIsStale_WhenTargetIsStale() { assertFalse(target.isStale()); assertFalse(delayed.isStale()); target.fireStale(); assertTrue(target.isStale()); assertTrue(delayed.isStale()); }
public void testIsStale_DuringDelay() { assertFalse(target.isStale()); assertFalse(delayed.isStale()); target.setValue(newValue); assertFalse(target.isStale()); assertTrue(delayed.isStale()); }
private void assertFiresPendingValueChange(Runnable runnable) { ValueChangeEventTracker tracker = ValueChangeEventTracker.observe(delayed); target.setValue(newValue); assertTrue(delayed.isStale()); assertEquals(0, tracker.count); runnable.run(); assertFalse(delayed.isStale()); assertEquals(1, tracker.count); assertEquals(oldValue, tracker.event.diff.getOldValue()); assertEquals(newValue, tracker.event.diff.getNewValue()); }