Пример #1
0
        public void should_be_straight_2()
        {
            var y = new Yatzy(
                new FakeDice6(5),
                new FakeDice6(1),
                new FakeDice6(3),
                new FakeDice6(2),
                new FakeDice6(4)
                );

            y.Roll();

            bool result = y.IsSmallStraight();

            Assert.IsTrue(result);
        }
Пример #2
0
        public void should_not_be_straight_1()
        {
            var y = new Yatzy(
                new FakeDice6(1),
                new FakeDice6(1),
                new FakeDice6(3),
                new FakeDice6(4),
                new FakeDice6(5)
                );

            y.Roll();

            bool result = y.IsSmallStraight();

            Assert.IsFalse(result);
        }
Пример #3
0
        public void cant_get_straight_all_the_time()
        {
            var y = new Yatzy();

            int nrOfStraights = 0;

            for (int i = 0; i < 50; i++)
            {
                y.Roll();
                if (y.IsSmallStraight())
                {
                    nrOfStraights++;
                }
            }

            // Hope we don't get only straight
            Assert.IsTrue(nrOfStraights != 50);
        }