use of com.b3dgs.lionengine.graphic.Image in project lionengine by b3dgs.
the class ImageTest method testSetOriginNull.
/**
* Test origin <code>null</code>.
*/
@Test(expected = LionEngineException.class)
public void testSetOriginNull() {
final Image image = new ImageImpl(Graphics.createImageBuffer(64, 32));
image.setOrigin(null);
}
use of com.b3dgs.lionengine.graphic.Image in project lionengine by b3dgs.
the class ImageTest method testRender.
/**
* Test the render.
*/
@Test
public void testRender() {
final Graphic g = Graphics.createImageBuffer(100, 100).createGraphic();
try {
final Image image = new ImageImpl(Graphics.createImageBuffer(64, 32));
image.render(g);
} finally {
g.dispose();
}
}
use of com.b3dgs.lionengine.graphic.Image in project lionengine by b3dgs.
the class ImageTest method testConstructorSurface.
/**
* Test constructor with surface.
*/
@Test
public void testConstructorSurface() {
final ImageBuffer surface = Graphics.createImageBuffer(64, 32);
final Image image = new ImageImpl(surface);
Assert.assertTrue(image.isLoaded());
Assert.assertEquals(surface, image.getSurface());
Assert.assertEquals(64, image.getWidth());
Assert.assertEquals(32, image.getHeight());
}
use of com.b3dgs.lionengine.graphic.Image in project lionengine by b3dgs.
the class ImageTest method testEquals.
/**
* Test equals.
*/
@Test
public void testEquals() {
final ImageBuffer surface = Graphics.createImageBuffer(64, 32);
final Image image = new ImageImpl(surface);
final Image imageMedia = new ImageImpl(media);
imageMedia.load();
Assert.assertEquals(image, image);
Assert.assertEquals(image, new ImageImpl(surface));
Assert.assertEquals(imageMedia, imageMedia);
Assert.assertNotEquals(image, null);
Assert.assertNotEquals(image, new Object());
Assert.assertNotEquals(image, new ImageImpl(media));
Assert.assertNotEquals(imageMedia, new ImageImpl(media));
Assert.assertNotEquals(image, new ImageImpl(Graphics.createImageBuffer(64, 32)));
Assert.assertNotEquals(image, new ImageImpl(Graphics.createImageBuffer(32, 32)));
Assert.assertNotEquals(image, new ImageImpl(Graphics.createImageBuffer(64, 64)));
Assert.assertNotEquals(image, new ImageImpl(Graphics.createImageBuffer(32, 64)));
}
use of com.b3dgs.lionengine.graphic.Image in project lionengine by b3dgs.
the class ImageTest method testLoadSurface.
/**
* Test load with surface.
*/
@Test(expected = LionEngineException.class)
public void testLoadSurface() {
final Image image = new ImageImpl(Graphics.createImageBuffer(64, 32));
image.load();
}
Aggregations