Coverage Summary for Class: WeatherTest (io.team9.game.tests.Entitys)

Class Class, % Method, % Line, %
WeatherTest 100% (1/1) 100% (3/3) 100% (16/16)


1 package io.team9.game.tests.Entitys; 2  3 import com.badlogic.gdx.math.Vector2; 4 import com.mygdx.game.Components.Transform; 5 import com.mygdx.game.Entitys.Weather; 6 import com.mygdx.game.Managers.GameManager; 7 import com.mygdx.game.Managers.PhysicsManager; 8 import io.team9.game.tests.GdxTestRunner; 9 import org.junit.Test; 10 import org.junit.runner.RunWith; 11  12 import static org.junit.Assert.assertEquals; 13 import static org.junit.Assert.assertFalse; 14  15 @RunWith(GdxTestRunner.class) 16 public class WeatherTest { 17  18  @Test 19  public void createWeatherTest(){ 20  PhysicsManager.Initialize(); 21  GameManager.Initialize(); 22  23  Weather weather = new Weather(); 24  weather.getComponent(Transform.class).getPosition(); 25  Vector2 pos = new Vector2(900, 800); 26  assertEquals("Should start at 900, 800",pos,weather.getComponent(Transform.class).getPosition()); 27  } 28  29  @Test 30  public void moveWeatherTest(){ 31  PhysicsManager.Initialize(); 32  GameManager.Initialize(); 33  34  Weather weather = new Weather(); 35  weather.getComponent(Transform.class).getPosition(); 36  weather.moveWeather(); 37  weather.moveWeather(); 38  weather.moveWeather(); 39  Vector2 pos = new Vector2(900, 800); 40  assertFalse(pos == weather.getComponent(Transform.class).getPosition()); 41  } 42  43  44 }