package de.gurkenlabs.litiengine.graphics;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.awt.Color;
import java.awt.geom.Point2D;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import de.gurkenlabs.litiengine.Game;
import de.gurkenlabs.litiengine.graphics.emitters.particles.RectangleFillParticle;
import de.gurkenlabs.litiengine.physics.CollisionType;

public class ParticleTests {
  @BeforeAll
  public static void setup() {
    Game.init(Game.COMMADLINE_ARG_NOGUI);
  }

  @Test
  public void testDeltaSize() {
    RectangleFillParticle part = new RectangleFillParticle(10, 10, Color.WHITE, 300);
    part.setCollisionType(CollisionType.NONE);
    part.setDeltaHeight(0.1f);
    part.setDeltaWidth(0.1f);

    part.update(new Point2D.Double(0, 0), 1);

    assertEquals(10.1f, part.getWidth());
    assertEquals(10.1f, part.getHeight());
  }
  
  @Test
  public void testDeltaLocation() {
    RectangleFillParticle part = new RectangleFillParticle(10, 10, Color.WHITE, 300);
    part.setCollisionType(CollisionType.NONE);
    part.setDeltaX(0.1f);
    part.setDeltaY(0.1f);
    part.setDeltaIncX(0.01f);
    part.setDeltaIncY(0.01f);
    part.update(new Point2D.Double(0, 0), 1);

    assertEquals(0.1f, part.getX());
    assertEquals(0.1f, part.getY());
    
    part.update(new Point2D.Double(0, 0), 1);
    
    assertEquals(0.21f, part.getX(), 0.0001);
    assertEquals(0.21f, part.getY(), 0.0001);
  }
}

@@ -33,24 +33,91 @@
 .graphics;%0A%0A
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;%0A
 import stati
@@ -218,16 +218,50 @@
 Point2D;
+%0Aimport java.awt.geom.Rectangle2D;
 %0A%0Aimport
@@ -432,199 +432,1554 @@
 les.
-RectangleFillParticle;%0Aimport de.gurkenlabs.litiengine.physics.CollisionType;%0A%0Apublic class ParticleTests %7B%0A  @BeforeAll%0A  public static void setup() %7B%0A    Game.init(Game.COMMADLINE_ARG_NOGUI
+LeftLineParticle;%0Aimport de.gurkenlabs.litiengine.graphics.emitters.particles.LightParticle;%0Aimport de.gurkenlabs.litiengine.graphics.emitters.particles.OvalOutlineParticle;%0Aimport de.gurkenlabs.litiengine.graphics.emitters.particles.RectangleFillParticle;%0Aimport de.gurkenlabs.litiengine.graphics.emitters.particles.RectangleOutlineParticle;%0Aimport de.gurkenlabs.litiengine.graphics.emitters.particles.RightLineParticle;%0Aimport de.gurkenlabs.litiengine.graphics.emitters.particles.ShimmerParticle;%0Aimport de.gurkenlabs.litiengine.graphics.emitters.particles.TextParticle;%0Aimport de.gurkenlabs.litiengine.physics.CollisionType;%0A%0Apublic class ParticleTests %7B%0A  @BeforeAll%0A  public static void setup() %7B%0A    Game.init(Game.COMMADLINE_ARG_NOGUI);%0A  %7D%0A%0A  @Test%0A  public void initializeParticleTypes() %7B%0A    assertDoesNotThrow(() -%3E new LeftLineParticle(10, 10, Color.WHITE, 300));%0A    assertDoesNotThrow(() -%3E new LightParticle(100, 100, 10, 10, Color.WHITE, 300));%0A    assertDoesNotThrow(() -%3E new OvalOutlineParticle(10, 10, Color.WHITE, 300));%0A    assertDoesNotThrow(() -%3E new RectangleFillParticle(10, 10, Color.WHITE, 300));%0A    assertDoesNotThrow(() -%3E new RectangleOutlineParticle(10, 10, Color.WHITE, 300));%0A    assertDoesNotThrow(() -%3E new RightLineParticle(10, 10, Color.WHITE, 300));%0A    assertDoesNotThrow(() -%3E new ShimmerParticle(new Rectangle2D.Double(0, 0, 100, 100), 10, 10, Color.WHITE));%0A    assertDoesNotThrow(() -%3E new TextParticle(null, Color.WHITE, 300));%0A    assertDoesNotThrow(() -%3E new TextParticle(%22test%22, Color.WHITE, 300)
 );%0A 
@@ -2353,18 +2353,16 @@
 ));%0A  %7D%0A
-  
 %0A  @Test
@@ -2764,20 +2764,16 @@
 etY());%0A
-    
 %0A    par
@@ -2811,20 +2811,16 @@
 0), 1);%0A
-    
 %0A    ass

Add a test case for initializing all particle implementations