package de.gurkenlabs.litiengine;

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

import java.io.File;

import org.junit.jupiter.api.Test;

public class GameTest {
  @Test
  public void testGameInitialization() {
    try {
      Game.init(Game.COMMADLINE_ARG_NOGUI);

      assertNotNull(Game.getRenderLoop());
      assertNotNull(Game.getLoop());
      assertNotNull(Game.getCamera());
      assertNotNull(Game.getScreenManager());
      assertNotNull(Game.getPhysicsEngine());
      assertNotNull(Game.getRenderEngine());
    } finally {
      final File configFile = new File(Game.getConfiguration().getFileName());
      if (configFile.exists()) {
        configFile.delete();
      }
    }
  }
}

@@ -94,152 +94,570 @@
 ll;%0A
-%0Aimport java.io.File;%0A%0Aimport org.junit.jupiter.api.Test;%0A%0Apublic class GameTest %7B%0A  @Test%0A  public void testGameInitialization
+import static org.junit.jupiter.api.Assertions.assertTrue;%0A%0Aimport java.io.File;%0A%0Aimport org.junit.jupiter.api.AfterEach;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0A%0Apublic class GameTest %7B%0A  private static boolean wasCalled;%0A%0A  @BeforeEach%0A  public void prepare() %7B%0A    wasCalled = false;%0A  %7D%0A%0A  @AfterEach%0A  public void cleanup() %7B%0A    final File configFile = new File(Game.getConfiguration().getFileName());%0A    if (configFile.exists
 ()
+)
  %7B%0A    
-try %7B%0A  
+  configFile.delete();%0A    %7D%0A  %7D%0A%0A  @Test%0A  public void testGameInitialization() %7B%0A
     
@@ -695,26 +695,24 @@
 OGUI);%0A%0A    
- 
- 
 assertNotNul
@@ -732,34 +732,32 @@
 derLoop());%0A    
-  
 assertNotNull(Ga
@@ -767,34 +767,32 @@
 getLoop());%0A    
- 
- 
 assertNotNull(Ga
@@ -804,26 +804,24 @@
 tCamera());%0A
-  
     assertNo
@@ -848,34 +848,32 @@
 Manager());%0A    
-  
 assertNotNull(Ga
@@ -892,26 +892,24 @@
 sEngine());%0A
-  
     assertNo
@@ -945,176 +945,556 @@
 ;%0A  
-  %7D finally %7B%0A      final File configFi
+%7D%0A%0A  @Test%0A  public void testInitializedListeners() %7B%0A    Game.addGameListener(new GameAdapter() %7B%0A      @Override%0A      public void initialized(String... args) %7B%0A        wasCal
 le
+d
  = 
-new File(Game.getConfiguration().getFileName());%0A      if (configFile.exists()) %7B%0A        configFile.delete();%0A      %7D%0A    %7D
+true;%0A      %7D%0A    %7D);%0A%0A    Game.init(Game.COMMADLINE_ARG_NOGUI);%0A%0A    assertTrue(wasCalled);%0A  %7D%0A%0A  @Test%0A  public void testStartedListeners() %7B%0A    Game.addGameListener(new GameAdapter() %7B%0A      @Override%0A      public void started() %7B%0A        wasCalled = true;%0A      %7D%0A    %7D);%0A%0A    Game.init(Game.COMMADLINE_ARG_NOGUI);%0A    Game.start();%0A    assertTrue(wasCalled);
 %0A  %7D

Add tests for GameListeners.