Exemple #1
0
        public void IsEligible_returnsTrue()
        {
            //Arrange
            var cardToPlay = new Card(Suits.Clubs, CardValue.Eight);
            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.Clubs].HighValue = CardValue.Seven;
            expected[Suits.Clubs].LowValue  = CardValue.Seven;
            expected[Suits.Clubs].IsOpen    = true;

            object expectedValue = expected as object;

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

            //Act
            var eligible = _board.IsEligible(cardToPlay);

            //Assert
            eligible.Should().BeTrue();
        }
Exemple #2
0
 public bool UnableToPlay()
 {
     return(_hand.Any(x => _board.IsEligible(x)));
 }