Exemplo n.º 1
0
        public void TwentyPointGeneratorOnlyHasASingleScoreBelowTen()
        {
            var gen    = new TwentyPointBuy();
            var scores = gen.GetScores();

            Assert.Equal(1, scores.Where(score => score < 10).Count());
        }
Exemplo n.º 2
0
        public void TwentyPointGeneratorSpendsAllPointsPossibleToCreateScores()
        {
            var gen       = new TwentyPointBuy();
            var scores    = gen.GetScores();
            var costTotal = 0;

            string scoreString = string.Join(",", scores);

            Assert.Equal(scores.Count, 6);

            foreach (var s in scores)
            {
                Assert.True(s >= 7);
                Assert.True(s <= 18);
                costTotal += gen.PointCosts.PointCosts[s];
            }
            Assert.True(scores.Any(x => x < 10));
            Assert.Equal(costTotal, 20);
        }