-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49262ad
commit 4c02221
Showing
4 changed files
with
75 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package entity; | ||
|
||
import engine.DrawManager; | ||
import engine.GameState; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Set; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class BossTest { | ||
private Boss boss; | ||
Set<Bullet> bullets; | ||
@BeforeEach | ||
void setUp() { | ||
boss = new Boss(0,0, DrawManager.SpriteType.Boss,new GameState(1,1,1,1,1)); | ||
} | ||
|
||
@Test | ||
void doPattern() { | ||
boss.doPattern(bullets); | ||
for (Bullet bullet: bullets){ | ||
assertEquals(bullet.getSpeed(),4); | ||
} | ||
} | ||
|
||
@Test | ||
void bossShoot() { | ||
} | ||
|
||
@Test | ||
void boosShootWithX() { | ||
} | ||
|
||
@Test | ||
void bossAttacked() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package entity; | ||
|
||
import entity.Bullet; | ||
import org.junit.jupiter.api.*; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class BulletTest { | ||
|
||
private Bullet bullet; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
bullet = new Bullet(3, 80, 10, 0); | ||
bullet.setXspeed(3); | ||
} | ||
|
||
@Test | ||
void update() { | ||
bullet.update(); | ||
assertEquals(6, bullet.getPositionX()); | ||
assertEquals(90, bullet.getPositionY()); | ||
} | ||
|
||
void setXspeed(){ | ||
bullet.setXspeed(19); | ||
assertEquals(19,bullet.getX_speed()); | ||
} | ||
|
||
void setYspeed(){ | ||
bullet.setSpeed(23); | ||
assertEquals(23,bullet.getSpeed()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters