@Test public void testaahasHitSomethingKunPitaisiOsua() { testbullet = new Bullet(tilemap, Direction.LEFT); testbullet.setPosition(32, 32); testbullet.update(); assertTrue(testbullet.hasHitSomething()); }
@Test public void testaahasHitSomethingKunEiOsuMihinkaan() { testbullet = new Bullet(tilemap, Direction.LEFT); testbullet.setPosition(200, 200); testbullet.update(); assertFalse(testbullet.hasHitSomething()); }
@Test public void testaaUpdatenvaikutus() { testbullet = new Bullet(tilemap, Direction.LEFT); testbullet.update(); testbullet.setMovingVector(Direction.NULL); testbullet.update(); assertTrue(testbullet.shouldBeRemoved()); }
@Test public void testaaVektorinAsetus() { testbullet = new Bullet(tilemap, Direction.LEFT); testbullet.setMovingVector(Direction.TOPRIGHT); assertEquals(7 * 0.71, testbullet.dx, 0); assertEquals(-7 * 0.71, testbullet.dy, 0); }
@Test public void testaaShouldBeRemoved() { testbullet = new Bullet(tilemap, Direction.BOTTOMLEFT); assertFalse(testbullet.shouldBeRemoved()); }