コード例 #1
0
        public void PlayerLeftCommand()
        {
            var c  = GameCommandMock.PlayerLeftCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.PlayerName, dc.PlayerName);
        }
コード例 #2
0
        public void GameStartedCommand()
        {
            var c  = GameCommandMock.GameStartedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.NeededBlindAmount, dc.NeededBlindAmount);
        }
コード例 #3
0
        public void PlayerSitOutCommand()
        {
            var c  = GameCommandMock.PlayerSitOutCommand();
            var dc = GetDecodedCommand(c);

            ComparePlayerSitOutCommand(c, dc);
        }
コード例 #4
0
        public void SeatUpdatedCommand()
        {
            var c  = GameCommandMock.SeatUpdatedCommand();
            var dc = GetDecodedCommand(c);

            CompareSeatInfo.Compare(c.Seat, dc.Seat);
        }
コード例 #5
0
        public void GameEndedCommand()
        {
            var c  = GameCommandMock.GameEndedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.CommandName, dc.CommandName);
        }
コード例 #6
0
        public void TableClosedCommand()
        {
            var c  = GameCommandMock.TableClosedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.CommandName, dc.CommandName);
        }
コード例 #7
0
        public void PlayerPlayMoneyCommand()
        {
            var c  = GameCommandMock.PlayerPlayMoneyCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.AmountPlayed, dc.AmountPlayed);
        }
コード例 #8
0
        public void PlayerSitOutResponse()
        {
            var c  = GameCommandMock.PlayerSitOutResponse();
            var dc = GetDecodedResponse <PlayerSitOutResponse, PlayerSitOutCommand>(c);

            Assert.AreEqual(c.Success, dc.Success);
            ComparePlayerSitOutCommand(c.Command, dc.Command);
        }
コード例 #9
0
        public void BetTurnEndedCommand()
        {
            var c  = GameCommandMock.BetTurnEndedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.PotsAmounts.Count, dc.PotsAmounts.Count);
            Assert.IsFalse(c.PotsAmounts.Except(dc.PotsAmounts).Any());
        }
コード例 #10
0
        public void PlayerDiscardActionCommand()
        {
            var c  = GameCommandMock.PlayerDiscardActionCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.CardsDiscarded.Length, dc.CardsDiscarded.Length);
            Assert.IsFalse(c.CardsDiscarded.Except(dc.CardsDiscarded).Any());
        }
コード例 #11
0
        public void DiscardRoundStartedCommand()
        {
            var c  = GameCommandMock.DiscardRoundStartedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.MaximumCardsToDiscard, dc.MaximumCardsToDiscard);
            Assert.AreEqual(c.MinimumCardsToDiscard, dc.MinimumCardsToDiscard);
        }
コード例 #12
0
        public void PlayerTurnBeganCommand()
        {
            var c  = GameCommandMock.PlayerTurnBeganCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.NoSeat, dc.NoSeat);
            Assert.AreEqual(c.MinimumRaiseAmount, dc.MinimumRaiseAmount);
        }
コード例 #13
0
        public void PlayerSitInResponse()
        {
            var c  = GameCommandMock.PlayerSitInResponse();
            var dc = GetDecodedResponse <PlayerSitInResponse, PlayerSitInCommand>(c);

            Assert.AreEqual(c.NoSeat, dc.NoSeat);
            ComparePlayerSitInCommand(c.Command, dc.Command);
        }
コード例 #14
0
        public void BetTurnStartedCommand()
        {
            var c  = GameCommandMock.BetTurnStartedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.BettingRoundId, dc.BettingRoundId);
            Assert.AreEqual(c.Cards.Length, dc.Cards.Length);
            Assert.IsFalse(c.Cards.Except(dc.Cards).Any());
        }
コード例 #15
0
        public void PlayerHoleCardsChangedCommand()
        {
            var c  = GameCommandMock.PlayerHoleCardsChangedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.NoSeat, dc.NoSeat);
            Assert.AreEqual(c.Cards.Length, dc.Cards.Length);
            Assert.IsFalse(c.Cards.Except(dc.Cards).Any());
            Assert.AreEqual(c.PlayerState, dc.PlayerState);
        }
コード例 #16
0
        public void DiscardRoundEndedCommand()
        {
            var c  = GameCommandMock.DiscardRoundEndedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.CardsDiscarded.Length, dc.CardsDiscarded.Length);
            for (int i = 0; i < c.CardsDiscarded.Length; ++i)
            {
                CompareDiscardInfo.Compare(c.CardsDiscarded[i], dc.CardsDiscarded[i]);
            }
        }
コード例 #17
0
        public void GameStartedCommand()
        {
            var c  = GameCommandMock.GameStartedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.NeededBlindAmount, dc.NeededBlindAmount);
            Assert.AreEqual(c.Seats.Count, dc.Seats.Count);
            for (int i = 0; i < c.Seats.Count; ++i)
            {
                CompareSeatInfo.Compare(c.Seats[i], dc.Seats[i]);
            }
        }
コード例 #18
0
        public void GameMessageCommandRaisingCapped()
        {
            var c  = GameCommandMock.GameMessageCommandRaisingCapped();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.Message, dc.Message);

            var ci  = (GameMessageOptionsRaisingCapped)c.Info;
            var dci = (GameMessageOptionsRaisingCapped)dc.Info;

            Assert.AreEqual(ci.OptionType, dci.OptionType);
        }
コード例 #19
0
        public void GameMessageCommandPlayerLeft()
        {
            var c  = GameCommandMock.GameMessageCommandPlayerLeft();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.Message, dc.Message);

            var ci  = (GameMessageOptionPlayerLeft)c.Info;
            var dci = (GameMessageOptionPlayerLeft)dc.Info;

            Assert.AreEqual(ci.OptionType, dci.OptionType);
            Assert.AreEqual(ci.PlayerName, dci.PlayerName);
        }
コード例 #20
0
        public void GameMessageCommandGeneralInformation()
        {
            var c  = GameCommandMock.GameMessageCommandGeneralInformation();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.Message, dc.Message);

            var ci  = (GameMessageOptionGeneralInformation)c.Info;
            var dci = (GameMessageOptionGeneralInformation)dc.Info;

            Assert.AreEqual(ci.OptionType, dci.OptionType);
            Assert.AreEqual(ci.Message, dci.Message);
        }
コード例 #21
0
        public void PlayerTurnEndedCommand()
        {
            var c  = GameCommandMock.PlayerTurnEndedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.NoSeat, dc.NoSeat);
            Assert.AreEqual(c.TotalPlayedMoneyAmount, dc.TotalPlayedMoneyAmount);
            Assert.AreEqual(c.TotalSafeMoneyAmount, dc.TotalSafeMoneyAmount);
            Assert.AreEqual(c.TotalPot, dc.TotalPot);
            Assert.AreEqual(c.ActionTakenType, dc.ActionTakenType);
            Assert.AreEqual(c.ActionTakenAmount, dc.ActionTakenAmount);
            Assert.AreEqual(c.PlayerState, dc.PlayerState);
        }
コード例 #22
0
        public void BetTurnStartedCommand()
        {
            var c  = GameCommandMock.BetTurnStartedCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.BettingRoundId, dc.BettingRoundId);
            Assert.AreEqual(c.Cards.Length, dc.Cards.Length);
            Assert.IsFalse(c.Cards.Except(dc.Cards).Any());
            Assert.AreEqual(c.Seats.Count, dc.Seats.Count);
            for (int i = 0; i < c.Seats.Count; ++i)
            {
                CompareSeatInfo.Compare(c.Seats[i], dc.Seats[i]);
            }
        }
コード例 #23
0
        public void PlayerWonPotCommand()
        {
            var c  = GameCommandMock.PlayerWonPotCommand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.NoSeat, dc.NoSeat);
            Assert.AreEqual(c.PotId, dc.PotId);
            Assert.AreEqual(c.TotalPlayerMoney, dc.TotalPlayerMoney);
            Assert.AreEqual(c.WonAmount, dc.WonAmount);
            Assert.AreEqual(c.TotalPotAmount, dc.TotalPotAmount);
            Assert.AreEqual(c.WinningHand, dc.WinningHand);
            Assert.AreEqual(c.WinningCards.Length, dc.WinningCards.Length);
            for (int i = 0; i < c.WinningCards.Length; ++i)
            {
                Assert.AreEqual(c.WinningCards[i], dc.WinningCards[i]);
            }
        }
コード例 #24
0
        public void TableInfoCommand()
        {
            var c  = GameCommandMock.TableInfoCommand();
            var dc = GetDecodedCommand(c);

            CompareTableParams.Compare(c.Params, dc.Params);
            Assert.AreEqual(c.TotalPotAmount, dc.TotalPotAmount);
            Assert.AreEqual(c.PotsAmount.Count, dc.PotsAmount.Count);
            Assert.IsFalse(c.PotsAmount.Except(dc.PotsAmount).Any());
            Assert.AreEqual(c.BoardCards.Length, dc.BoardCards.Length);
            Assert.IsFalse(c.BoardCards.Except(dc.BoardCards).Any());
            Assert.AreEqual(c.Seats.Count, dc.Seats.Count);
            for (int i = 0; i < c.Seats.Count; ++i)
            {
                CompareSeatInfo.Compare(c.Seats[i], dc.Seats[i]);
            }
            Assert.AreEqual(c.GameHasStarted, dc.GameHasStarted);
        }
コード例 #25
0
        public void GameMessageCommandStudHighestHand()
        {
            var c  = GameCommandMock.GameMessageCommandStudHighestHand();
            var dc = GetDecodedCommand(c);

            Assert.AreEqual(c.Message, dc.Message);
            Assert.AreEqual(c.Info.OptionType, dc.Info.OptionType);

            var ci  = (GameMessageOptionsStudHighestHand)c.Info;
            var dci = (GameMessageOptionsStudHighestHand)dc.Info;

            Assert.AreEqual(ci.OptionType, dci.OptionType);
            Assert.AreEqual(ci.PlayerName, dci.PlayerName);
            Assert.AreEqual(ci.HighestHand, dci.HighestHand);
            Assert.AreEqual(ci.Cards.Length, dci.Cards.Length);
            for (int i = 0; i < ci.Cards.Length; ++i)
            {
                Assert.AreEqual(ci.Cards[i], dci.Cards[i]);
            }
        }
コード例 #26
0
 public void TableClosedCommand()
 {
     var c  = GameCommandMock.TableClosedCommand();
     var dc = GetDecodedCommand(c);
 }
コード例 #27
0
 public void GameEndedCommand()
 {
     var c  = GameCommandMock.GameEndedCommand();
     var dc = GetDecodedCommand(c);
 }