public void CanPlayTest() { Console.WriteLine("\nTesting Player : CanPlay()..."); Player player = new Player("John Doe"); Console.Write("\tPlayer cash > 0\t... "); player.setCash(100); Assert.IsTrue(player.canPlay()); Console.WriteLine("OK"); Console.Write("\tPlayer cash = 0\t... "); player.setCash(0); Assert.IsFalse(player.canPlay()); Console.WriteLine("OK"); Console.Write("\tPlayer cash < 0\t... "); player.setCash(-235); Assert.IsFalse(player.canPlay()); Console.WriteLine("OK"); }
public void SetBetTest() { Console.WriteLine("\nTesting Player : SetBet()..."); Player player = new Player("John Doe"); player.setCash(100); Console.Write("\tBet < cash\t... "); player.setBet(50); Assert.AreEqual(50, player.getBet()); Console.WriteLine("OK"); Console.Write("\tBet = cash\t... "); player.setBet(100); Assert.AreEqual(100, player.getBet()); Console.WriteLine("OK"); Console.Write("\tBet > cash\t... "); player.setBet(250); Assert.AreEqual(100, player.getBet()); Console.WriteLine("OK"); Console.Write("\tBet < 0\t\t... "); player.setBet(-250); Assert.AreEqual(0, player.getBet()); Console.WriteLine("OK"); }