Пример #1
0
        public void CupCanHaveABaseValueForTheRoll()
        {
            var cup = new Cup();

            cup.AddDie(Die.D4());
            cup.Modifier = 20;
            Assert.True(cup.Roll() >= 20);
        }
Пример #2
0
        public void AnyTypeOfDieMayBeAddedToTheCup()
        {
            var cup = new Cup();

            cup.AddDie(Die.D4());
            cup.AddDie(Die.D10());
            cup.AddDie(Die.D6());

            Assert.Equal(new Die[] { Die.D4(), Die.D10(), Die.D6() }, cup.Dice);
        }
Пример #3
0
 public void GetProperSidesOfDefaultDie()
 {
     Assert.Equal(DiceSides.d4, Die.D4().Sides);
     Assert.Equal(DiceSides.d6, Die.D6().Sides);
     Assert.Equal(DiceSides.d8, Die.D8().Sides);
     Assert.Equal(DiceSides.d10, Die.D10().Sides);
     Assert.Equal(DiceSides.d12, Die.D12().Sides);
     Assert.Equal(DiceSides.d20, Die.D20().Sides);
     Assert.Equal(DiceSides.d100, Die.D100().Sides);
 }
Пример #4
0
        public void ReturnsACountOfAllDiceInTheCup()
        {
            var cup = new Cup();

            cup.AddDie(Die.D10());
            Assert.Equal(1, cup.Count);
            cup.AddDie(Die.D4());
            Assert.Equal(2, cup.Count);
            cup.AddDie(Die.D6());
            Assert.Equal(3, cup.Count);
        }
Пример #5
0
        public void ToStringReturnsADieRepresentation()
        {
            var d4 = Die.D4();

            Assert.Equal("1d4", d4.ToString());
        }
Пример #6
0
 public void D4ReturnsAllSideValues()
 {
     ValidateAllSides(Die.D4());
     Assert.True(true);
 }