Coverage Summary for Class: ConstantsTest (io.team9.game.tests.AI.utils)

Class Class, % Method, % Line, %
ConstantsTest 100% (1/1) 100% (8/8) 100% (18/18)


1 package io.team9.game.tests.AI.utils; 2  3 import com.badlogic.gdx.math.Vector2; 4 import com.mygdx.utils.Constants; 5 import com.mygdx.utils.TileMapCells; 6 import io.team9.game.tests.GdxTestRunner; 7 import org.junit.Test; 8 import org.junit.runner.RunWith; 9  10 import static org.junit.Assert.*; 11  12 @RunWith(GdxTestRunner.class) 13 public class ConstantsTest { 14  15  Constants constants = new Constants(); 16  @Test 17  public void testFullScreen() { 18  assertFalse(constants.FULLSCREEN); 19  } 20  21  @Test 22  public void testTileSize() { 23  assertEquals( constants.TILE_SIZE, 32, 32); 24  } 25  26  @Test 27  public void testPhysics() { 28  assertEquals(constants.PHYSICS_TIME_STEP, 1.0f / 60.0f, 1.0f / 60.0f); 29  } 30  31  @Test 32  public void testVSTNC() { 33  assertTrue(constants.VSYNC); 34  } 35  36  @Test 37  public void testZoom() { 38  assertEquals(constants.ZOOM, 1.75f, 1.75f); 39  } 40  41  @Test 42  public void testBuildingScale() { 43  assertEquals(constants.BUILDING_SCALE, 1.5f, 1.5f); 44  } 45  46  @Test 47  public void testViewportUpdate() { 48  constants.SCREEN_WIDTH = 2; 49  constants.SCREEN_HEIGHT = 2; 50  constants.UPDATE_VIEWPORT(1, 2); 51  assertEquals(constants.VIEWPORT_HEIGHT, 2); 52  assertEquals(constants.VIEWPORT_WIDTH, 1); 53  assertEquals(constants.ASPECT_RATIO, constants.SCREEN_WIDTH / constants.SCREEN_HEIGHT, constants.SCREEN_WIDTH / constants.SCREEN_HEIGHT); 54  assertEquals(constants.HALF_VIEWPORT_HEIGHT, constants.VIEWPORT_HEIGHT / 2); 55  assertEquals(constants.HALF_VIEWPORT_WIDTH, constants.VIEWPORT_WIDTH / 2); 56  assertEquals(constants.DIMENSIONS, new Vector2(constants.VIEWPORT_WIDTH, constants.VIEWPORT_HEIGHT)); 57  assertEquals(constants.HALF_DIMENSIONS, new Vector2(constants.HALF_VIEWPORT_WIDTH, constants.HALF_VIEWPORT_HEIGHT)); 58  } 59  60 }