@Test public void testIsValidScreenSize() { final Dimension currentSize = HelperScreen.getCurrentScreenSize(); assertTrue(HelperScreen.isValidScreenSize(currentSize)); assertTrue( HelperScreen.isValidScreenSize( new Dimension(currentSize.width - 10, currentSize.height - 10))); assertFalse( HelperScreen.isValidScreenSize( new Dimension(currentSize.width + 10, currentSize.height + 10))); assertTrue( HelperScreen.isValidScreenSize(new Dimension(currentSize.width, currentSize.height - 10))); assertFalse( HelperScreen.isValidScreenSize(new Dimension(currentSize.width, currentSize.height + 10))); assertTrue( HelperScreen.isValidScreenSize(new Dimension(currentSize.width - 10, currentSize.height))); assertFalse( HelperScreen.isValidScreenSize(new Dimension(currentSize.width + 10, currentSize.height))); try { HelperScreen.isValidScreenSize(null); fail("minSize is null"); // $NON-NLS-1$ } catch (RuntimeExceptionIsNull ex) { // nothing to do } catch (Exception ex) { fail(ex.getMessage()); } }
@Test public void testGetCurrentScreenResolution() { // System.err.println(HelperScreen.getCurrentScreenResolution()); assertEquals( Toolkit.getDefaultToolkit().getScreenResolution(), HelperScreen.getCurrentScreenResolution()); }
@Test public void testGetCurrentColorModel() { // System.err.println(HelperScreen.getCurrentColorModel()); assertEquals(Toolkit.getDefaultToolkit().getColorModel(), HelperScreen.getCurrentColorModel()); }
@Test public void testGetCurrentScreenSize() { assertEquals(Toolkit.getDefaultToolkit().getScreenSize(), HelperScreen.getCurrentScreenSize()); }