Example #1
0
        public void CheckSpecialHands2()
        {
            GamingTable gamingTable = new GamingTable();

            Dictionary <int, HandWarGame <CardWarGame> > players = new Dictionary <int, HandWarGame <CardWarGame> >();

            HandWarGame <CardWarGame> Hand1 = new HandWarGame <CardWarGame>();

            HandWarGame <CardWarGame> Hand2 = new HandWarGame <CardWarGame>();

            Hand2.AddCard(new CardWarGame(CardValueEnum.Five, CardColorEnum.Spade));
            Hand2.AddCard(new CardWarGame(CardValueEnum.Six, CardColorEnum.Spade));
            Hand2.AddCard(new CardWarGame(CardValueEnum.Seven, CardColorEnum.Spade));
            Hand2.AddCard(new CardWarGame(CardValueEnum.Height, CardColorEnum.Spade));

            HandWarGame <CardWarGame> Hand3 = new HandWarGame <CardWarGame>();

            players.Add(1, Hand1);
            players.Add(2, Hand2);
            players.Add(3, Hand3);


            TableHistory tableHistory = gamingTable.PlayGameWhithGivenHand(players);

            Assert.AreEqual(2, tableHistory.GetHistories()[0].GetWinner());
        }
Example #2
0
        public void CheckSpecialHands3()
        {
            IGamingTable gamingTable = new GamingTable();

            Dictionary <int, HandWarGame <CardWarGame> > players = new Dictionary <int, HandWarGame <CardWarGame> >();

            HandWarGame <CardWarGame> Hand1 = new HandWarGame <CardWarGame>();

            HandWarGame <CardWarGame> Hand2 = new HandWarGame <CardWarGame>();

            HandWarGame <CardWarGame> Hand3 = new HandWarGame <CardWarGame>();

            players.Add(1, Hand1);
            players.Add(2, Hand2);
            players.Add(3, Hand3);


            TableHistory tableHistory = gamingTable.PlayGameWhithGivenHand(players);

            Assert.AreEqual(-1, tableHistory.GetHistories()[0].GetWinner()); //No winner
        }