Ejemplo n.º 1
0
        public void Start()
        {
            Console.WriteLine();
            var poker = new PokerGame();

            poker.RegisterPlayer(new Player(1, "Joe"));
            poker.RegisterPlayer(new Player(2, "Jen"));
            poker.RegisterPlayer(new Player(3, "Bob"));
            poker.StartGame();
            poker.Flop();
            poker.Turn();
            poker.River();
            poker.CheckPlayersHand();
            var winner = poker.ShowWinner();

            Console.WriteLine();
            Console.WriteLine("===========Showing Hands==============");

            foreach (var player in poker.Players)
            {
                Console.WriteLine("{0} ==> {1}", player.Name.ToUpper(), player.Hand.ToString());
            }
            Console.WriteLine();
            Console.WriteLine("==========WINNER/s===============");
            foreach (var w in winner)
            {
                Console.WriteLine("{0} ==> {1}", w.Name.ToUpper(), w.Hand.PokerHandName);
            }

            Console.ReadLine();
        }
Ejemplo n.º 2
0
        public void PokerGame_RandomScenarioTest()
        {
            var poker = new PokerGame();

            poker.RegisterPlayer(new Player(1, "Don"));
            poker.RegisterPlayer(new Player(2, "Juan"));

            poker.StartGame();
            poker.Flop();
            poker.Turn();
            poker.River();
            poker.CheckPlayersHand();
            var winner = poker.ShowWinner();

            Assert.IsTrue(winner.Count > 0);
        }