コード例 #1
0
        public void GivenAnArrayOfRolls_TheLenght_IsAsExpected()
        {
            var inputRolls = new[] { new Roll(0) };
            var rolls      = new BowlingRolls(inputRolls);

            Assert.AreEqual(1, rolls.Count);
        }
コード例 #2
0
        public void ItReturns_TheSumOfRequestedRolls(int howMany, int expectedTotal)
        {
            var inputRolls = Enumerable.Range(1, howMany)
                             .Select(value => new Roll(value))
                             .ToArray();

            var rolls = new BowlingRolls(inputRolls);

            Assert.AreEqual(expectedTotal, rolls.TakeRolls(howMany).Value);
        }
コード例 #3
0
        public void IfITake_ARoll_IHave_OneRollLess()
        {
            var inputRolls = new[] { new Roll(0) };
            var rolls      = new BowlingRolls(inputRolls);

            int count = rolls.Count;

            rolls.Dequeue();
            Assert.AreEqual(count - 1, rolls.Count);
        }