/*
 * Created on Nov 22, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package WheelOfFortune.game.player;
import junit.framework.TestCase;

/**
 * @author warren
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class PlayerTest extends TestCase {
	private String name = "NAME";
	public void testGetName()
	{
		Player p = new Player(name, Player.HUMAN_PLAYER);
		assertEquals(name, p.getName());
	}
	public void testGetRoundMoney()
	{
		Player p = new Player(name, Player.HUMAN_PLAYER);
		assertEquals(p.getRoundMoney(), 0);
		p.setRoundMoney(p.getRoundMoney()+500);
		assertEquals(p.getRoundMoney(), 500);
		p.setRoundMoney(p.getRoundMoney()-250);
		assertEquals(p.getRoundMoney(),250);
	}
	public void testSetRoundMoney()
	{
		Player p = new Player(name, Player.HUMAN_PLAYER);
		p.setRoundMoney(500);
		assertEquals(p.getRoundMoney(),500);
		p.setRoundMoney(-5);
		assertEquals(p.getRoundMoney(), 500);
	}
	public void testGetTotalMoney()
	{
		Player p = new Player(name, Player.HUMAN_PLAYER);
		assertEquals(p.getTotalMoney(), 0);
		p.setTotalMoney(p.getTotalMoney()+500);
		assertEquals(p.getTotalMoney(), 500);
	}
	public void testIsCPU()
	{
		Player p = new Player(name, Player.HUMAN_PLAYER);
		assertTrue(!p.isCPU());
		Player p2 = new Player(name, Player.EASY_CPU_PLAYER);
		Player p3 = new Player(name, Player.NORMAL_CPU_PLAYER);
		Player p4 = new Player(name, Player.HARD_CPU_PLAYER);
		assertTrue(p2.isCPU());
		assertTrue(p3.isCPU());
		assertTrue(p4.isCPU());
	}
}
