Coverage Summary for Class: PlayerTest (io.team9.game.tests.Entitys)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| PlayerTest | 100% (1/1) | 100% (2/2) | 100% (13/13) |
1 package io.team9.game.tests.Entitys; 2 import com.mygdx.game.Components.PlayerController; 3 import com.mygdx.game.Components.Transform; 4 import com.mygdx.game.Entitys.Player; 5 import com.mygdx.game.Managers.DifficultyManager; 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 13 import static org.junit.Assert.*; 14 @RunWith(GdxTestRunner.class) 15 public class PlayerTest { 16 17 @Test 18 public void playerSpawnTest(){ 19 PhysicsManager.Initialize(); 20 GameManager.Initialize(); 21 Player p = new Player(); 22 DifficultyManager.SelectEasy(); 23 p.updateHealth(); 24 assertEquals("Easy health should be 200",200,p.getHealth()); 25 DifficultyManager.SelectNormal(); 26 p.updateHealth(); 27 assertEquals("Normal health should be 100",100,p.getHealth()); 28 DifficultyManager.SelectHard(); 29 p.updateHealth(); 30 assertEquals("Hard health should be 50",50,p.getHealth()); 31 } 32 }