use of de.gurkenlabs.litiengine.graphics.RenderEngine in project litiengine by gurkenlabs.
the class AbilityTests method testRender.
@Test
void testRender() {
// arrange
TestAbility ability = new TestAbility(new Creature());
Graphics2D graphics = mock(Graphics2D.class);
RenderEngine renderEngine = mock(RenderEngine.class);
try (MockedStatic<Game> gameMockedStatic = mockStatic(Game.class)) {
gameMockedStatic.when(Game::graphics).thenReturn(renderEngine);
// act
ability.render(graphics);
// assert
verify(renderEngine, times(1)).renderShape(any(Graphics2D.class), any(Shape.class));
verify(renderEngine, times(1)).renderOutline(any(Graphics2D.class), any(Shape.class));
}
}
Aggregations