Exemple #1
0
        public void IsFirstTurn_returnsTrue()
        {
            //Arrange
            IDictionary <Suits, InGameSuit> expected = new Dictionary <Suits, InGameSuit>
            {
                { Suits.Diamonds, _fixture.Create <InGameSuit>() },
                { Suits.Spades, _fixture.Create <InGameSuit>() },
                { Suits.Hearts, _fixture.Create <InGameSuit>() },
                { Suits.Clubs, new InGameSuit(Suits.Clubs) }
            };

            expected[Suits.Diamonds].IsOpen = false;

            object expectedValue = expected as object;

            _memCache.Setup(x => x.TryGetValue(It.IsAny <object>(), out expectedValue)).Returns(true);

            //Act
            var firstTurn = _board.IsFirstTurn();

            //Assert
            firstTurn.Should().BeTrue();
        }
Exemple #2
0
        public void FirstTurn(IGameState state)
        {
            // If first turn check if can play
            if (_board.IsFirstTurn())
            {
                if (HasSevenDiamonds())
                {
                    //Play the seven of diamonds
                    var card = new Card(Suits.Diamonds, CardValue.Seven);

                    _board.SetGameBoardState(card);
                    UpdateHand(card, true);

                    var move = new MoveHistory
                    {
                        Player = this,
                        move   = card
                    };

                    state.AddMove(move);
                    return;
                }
            }
        }