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

Class Class, % Method, % Line, %
ChestTest 100% (1/1) 100% (2/2) 100% (11/11)


1 package io.team9.game.tests.Entitys; 2 import com.badlogic.gdx.math.Vector2; 3 import com.mygdx.game.Components.Transform; 4 import com.mygdx.game.Entitys.Chest; 5 import com.mygdx.game.Managers.GameManager; 6 import com.mygdx.game.Managers.PhysicsManager; 7 import io.team9.game.tests.GdxTestRunner; 8 import org.junit.Test; 9 import org.junit.runner.RunWith; 10  11  12 import static org.junit.Assert.*; 13 @RunWith(GdxTestRunner.class) 14 public class ChestTest { 15  16  @Test 17  public void createChestTest(){ 18  PhysicsManager.Initialize(); 19  GameManager.Initialize(); 20  21  Chest chest = new Chest(); 22  chest.getComponent(Transform.class).getPosition(); 23  Vector2 pos = new Vector2(0,0); 24  assertEquals("Should start at 0,0",pos,chest.getComponent(Transform.class).getPosition()); 25  pos.x=50; 26  pos.y=50; 27  chest.setPosition(pos); 28  assertEquals("Should be at the vectors location",pos,chest.getComponent(Transform.class).getPosition()); 29  30  } 31  32 }