Exemplo n.º 1
0
        public void ReturnsScore()
        {
            var section = new LowerSection(x => 1, x => 2, x => 3, x => 4, x => 5, x => 6, x => 7);

            section.Preview(new List <int>());
            section.Lock(ScoreCard.Items.ThreeOfAKind);
            section.Preview(new List <int>());
            section.Lock(ScoreCard.Items.FourOfAKind);
            section.Preview(new List <int>());

            Assert.Equal(3, section.Score);
        }
Exemplo n.º 2
0
        public void CannotLockInScoreThatIsNotPartOfTheUpperSection()
        {
            var section = new LowerSection(x => 1, x => 2, x => 3, x => 4, x => 5, x => 6, x => 7);

            section.Preview(new List <int>());

            Assert.Throws <Exception>(() => section.Lock(ScoreCard.Items.Ones));
        }
Exemplo n.º 3
0
        public void PreviewsTheScoreForSetOfDice()
        {
            var section = new LowerSection(x => 1, x => 2, x => 3, x => 4, x => 5, x => 6, x => 7);

            section.Preview(new List <int>());
            Assert.Equal(1, section.ThreeOfAKind);
            Assert.Equal(2, section.FourOfAKind);
            Assert.Equal(3, section.FullHouse);
            Assert.Equal(4, section.SmallStraight);
            Assert.Equal(5, section.LongStraight);
            Assert.Equal(6, section.Chance);
            Assert.Equal(7, section.Yahtzee);
        }
Exemplo n.º 4
0
        public void LockInLongStraightScore()
        {
            var section = new LowerSection(x => 1, x => 2, x => 3, x => 4, x => 5, x => 6, x => 7);

            section.Preview(new List <int>());
            section.Lock(ScoreCard.Items.LongStraight);

            Assert.Equal(0, section.ThreeOfAKind);
            Assert.Equal(0, section.FourOfAKind);
            Assert.Equal(0, section.FullHouse);
            Assert.Equal(0, section.SmallStraight);
            Assert.Equal(5, section.LongStraight);
            Assert.Equal(0, section.Chance);
            Assert.Equal(0, section.Yahtzee);
        }