@Test public void testMaxWidthOverrideThenRestoreComputedSize() { Region region = new MockRegion(10, 20, 100, 200, 500, 600); region.setMaxWidth(1000); region.setMaxWidth(Region.USE_COMPUTED_SIZE); // reset assertEquals(Region.USE_COMPUTED_SIZE, region.getMaxWidth(), 1e-100); assertEquals(500, region.maxWidth(-1), 1e-100); }
@Test public void testMaxWidthOverrideSetToPref() { Region region = new MockRegion(10, 20, 100, 200, 500, 600); assertEquals(500, region.maxWidth(-1), 1e-100); region.setMaxWidth(Region.USE_PREF_SIZE); assertEquals(Region.USE_PREF_SIZE, region.getMaxWidth(), 0); assertEquals(100, region.maxWidth(-1), 1e-100); }
@Test public void testMaxWidthOverride() { Region region = new MockRegion(10, 20, 100, 200, 500, 600); assertEquals(500, region.maxWidth(-1), 1e-100); region.setMaxWidth(550); assertEquals(550, region.getMaxWidth(), 1e-100); assertEquals(550, region.maxWidth(-1), 1e-100); }