示例#1
0
        public void Score_WrongCardAmount_Failed()
        {
            // Arrange
            var setValidator  = GenerateSetValidator();
            var unitUnderTest = new RoyalFlushScore(setValidator);

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

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

            // Assert
            Assert.False(result.IsValid);
        }
示例#2
0
        public void Score_RoyalFlushCardsWithOneWrongColor_Failed()
        {
            // Arrange
            var setValidator  = GenerateSetValidator();
            var unitUnderTest = new RoyalFlushScore(setValidator);

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

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

            // Assert
            Assert.False(result.IsValid);
        }
示例#3
0
        public void Score_RoyalFlushCards_SuccessAndHighestScore()
        {
            // Arrange
            var setValidator  = GenerateSetValidator();
            var unitUnderTest = new RoyalFlushScore(setValidator);

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

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

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