-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flushed out the player class and the testplayer class a little.
- Loading branch information
Gavin Li
committed
Feb 2, 2015
1 parent
5d94bdd
commit dd2991f
Showing
2 changed files
with
80 additions
and
2 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
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 |
---|---|---|
@@ -1,8 +1,24 @@ | ||
package tests; | ||
|
||
import junit.framework.TestCase; | ||
import game.Player; | ||
|
||
public class TestPlayer | ||
public class TestPlayer extends TestCase | ||
{ | ||
|
||
private Player p; | ||
|
||
public void setup() | ||
{ | ||
p = new Player("TestPlayer", 1000, 1); | ||
} | ||
|
||
//test cash system for Player class | ||
public void testPlayerCashSystem() | ||
{ | ||
setup(); | ||
p.deductCash(500); | ||
assertEquals(500, p.getPlayerCash()); | ||
p.increaseCash(500); | ||
assertEquals(1000,p.getPlayerCash()); | ||
} | ||
} |