Beispiel #1
0
        public void UpdateBestHand()
        {
            Game       g      = new Game(new GamePreferences());
            GameLogger logger = g.GetLogger();

            UserProfile Niv   = new UserProfile("Niv", "123");
            UserProfile Omer  = new UserProfile("Omer", "456");
            UserProfile Naor  = new UserProfile("Naor", "789");
            UserProfile Koren = new UserProfile("Koren", "9");
            UserProfile Ohad  = new UserProfile("Ohad", "8");

            PlayingUser nivPlayer = new PlayingUser(Niv.Username, 1000, g);
            PlayingUser OPlayer   = new PlayingUser(Omer.Username, 1000, g);
            PlayingUser NPlayer   = new PlayingUser(Naor.Username, 1000, g);
            PlayingUser KPlayer   = new PlayingUser(Koren.Username, 1000, g);
            PlayingUser OhPlayer  = new PlayingUser(Ohad.Username, 1000, g);

            g.addPlayer(nivPlayer);
            g.addPlayer(OPlayer);
            g.addPlayer(NPlayer);
            g.addPlayer(KPlayer);
            g.addPlayer(OhPlayer);

            nivPlayer.SetFakeUserInput(new Queue <string>(new[] { "5", "0", "100" }));
            OPlayer.SetFakeUserInput(new Queue <string>(new[] { "0", "0", "100", "100", "0", "50", "Fold" }));
            NPlayer.SetFakeUserInput(new Queue <string>(new[] { "10", "100", "100", "100" }));
            KPlayer.SetFakeUserInput(new Queue <string>(new[] { "10", "100", "100", "100" }));
            OhPlayer.SetFakeUserInput(new Queue <string>(new[] { "10", "100", "100", "100" }));
            g.StartGame();

            nivPlayer.SetFakeUserInput(new Queue <string>(new[] { "10", "100", "100", "100" }));
            OPlayer.SetFakeUserInput(new Queue <string>(new[] { "5", "0", "100" }));
            NPlayer.SetFakeUserInput(new Queue <string>(new[] { "0", "0", "100", "100", "0", "50", "Fold" }));
            KPlayer.SetFakeUserInput(new Queue <string>(new[] { "10", "100", "100", "100" }));
            OhPlayer.SetFakeUserInput(new Queue <string>(new[] { "10", "100", "100", "100" }));
            g.StartGame();

            foreach (PlayingUser player in g.GetPlayers())
            {
                if (player.GetCredit() > 1000)
                {
                    Assert.AreNotEqual(CardAnalyzer.HandRank.HighCard, player.GetBestHand());
                }
            }
        }