Assert.assertTrue(mode.getRefreshRate()> 0);
}
@Test
public void getDisplayModeWithSameRefreshRateAndColorDepth() {
CanvasFactory factory = new ch.blackspirit.graphics.jogl.CanvasFactory();
DisplayMode currentMode = factory.getDisplayMode();
DisplayMode expectedMode = null;
for (DisplayMode mode: factory.getDisplayModes()) {
if (mode.getColorDepth() == currentMode.getColorDepth() &&
mode.getRefreshRate() == currentMode.getRefreshRate()) {
expectedMode = mode;
break;
}
}
if (expectedMode == null)
return;
DisplayMode actualMode = factory.getDisplayMode(expectedMode.getWidth(), expectedMode.getHeight());
assertMode(actualMode);
Assert.assertEquals(expectedMode.getWidth(), actualMode.getWidth());
Assert.assertEquals(expectedMode.getHeight(), actualMode.getHeight());
Assert.assertEquals(expectedMode.getColorDepth(), actualMode.getColorDepth());
Assert.assertEquals(expectedMode.getRefreshRate(), actualMode.getRefreshRate());