Beispiel #1
0
        public void Score_FlushCardsWithOneWrongCardColor_Failed()
        {
            // Arrange
            var setValidator  = GenerateSetValidator();
            var unitUnderTest = new FlushScore(setValidator);

            setValidator.Validate(Arg.Any <CardSet>()).Returns(false);
            CardSet set = new CardSet(new HashSet <Card>()
            {
                GenerateCard(CardValue.Ten),
                GenerateCard(CardValue.Three),
                GenerateCard(CardValue.Queen, CardColor.Goblet),
                GenerateCard(CardValue.Two),
                GenerateCard(CardValue.Ace)
            });

            // Act
            var result = unitUnderTest.Score(
                set);

            // Assert
            Assert.False(result.IsValid);
        }
Beispiel #2
0
        public void Score_ValidFlushCards_SuccessAndScore()
        {
            // Arrange
            var setValidator  = GenerateSetValidator();
            var unitUnderTest = new FlushScore(setValidator);

            setValidator.Validate(Arg.Any <CardSet>()).Returns(true);
            CardSet set = new CardSet(new HashSet <Card>()
            {
                GenerateCard(CardValue.Ten),
                GenerateCard(CardValue.Three),
                GenerateCard(CardValue.Queen),
                GenerateCard(CardValue.Two),
                GenerateCard(CardValue.Ace)
            });

            // Act
            var result = unitUnderTest.Score(
                set);

            // Assert
            Assert.True(result.IsValid);
        }