예제 #1
0
 @Test
 public void canReturnAPercentageFromAPositionY() {
   gameWindow.setDimension(100, 200);
   gameWindow.setPosition(50, 60);
   assertThat(gameWindow.getPercentageY(99)).isEqualTo((99 - 60) / (float) 200);
 }
예제 #2
0
 @Test
 public void canReturnAPositionYFromAPercentage() {
   gameWindow.setDimension(100, 200);
   gameWindow.setPosition(50, 60);
   assertThat(gameWindow.getPositionY(0.2f)).isEqualTo((int) (60 + 200 * 0.2f));
 }
예제 #3
0
 @Test
 public void canChangePositionOfGameWindow() {
   gameWindow.setPosition(50, 130);
   assertThat(gameWindow.x).isEqualTo(50);
   assertThat(gameWindow.y).isEqualTo(130);
 }
예제 #4
0
 @Test
 public void canModifyDimensionOfAnExistingGameWindow() {
   gameWindow.setDimension(300, 10);
   assertThat(gameWindow.getWidth()).isEqualTo(300);
   assertThat(gameWindow.getHeight()).isEqualTo(10);
 }
예제 #5
0
 @Test
 public void canRetrieveHeightOfAGameWindow() {
   assertThat(gameWindow.getHeight()).isEqualTo(200);
 }
예제 #6
0
 @Test
 public void canRetrieveWithOfAGameWindow() {
   assertThat(gameWindow.getWidth()).isEqualTo(100);
 }