@Test public void testMaxHeightOverrideThenRestoreComputedSize() { Region region = new MockRegion(10, 20, 100, 200, 500, 600); region.setMaxHeight(800); region.setMaxHeight(Region.USE_COMPUTED_SIZE); // reset assertEquals(Region.USE_COMPUTED_SIZE, region.getMaxHeight(), 0); assertEquals(600, region.maxHeight(-1), 1e-100); }
@Test public void testMaxHeightOverrideSetToPref() { Region region = new MockRegion(10, 20, 100, 200, 500, 600); assertEquals(600, region.maxHeight(-1), 1e-100); region.setMaxHeight(Region.USE_PREF_SIZE); assertEquals(Region.USE_PREF_SIZE, region.getMaxHeight(), 0); assertEquals(200, region.maxHeight(-1), 1e-100); }
@Test public void testMaxHeightOverride() { Region region = new MockRegion(10, 20, 100, 200, 500, 600); assertEquals(600, region.maxHeight(-1), 1e-100); region.setMaxHeight(650); assertEquals(650, region.getMaxHeight(), 1e-100); assertEquals(650, region.maxHeight(-1), 1e-100); }