Esempio n. 1
0
        public void ToStringReturnsALogicalVersionOfDie()
        {
            var d4             = Die.D4();
            var result         = d4.Roll();
            var expectedString = string.Format("[Die: Sides={0}, LastRoll={1}]", d4.Sides, result);

            Assert.AreEqual(expectedString, d4.ToString());
        }
Esempio n. 2
0
        public void CupCanHaveABaseValueForTheRoll()
        {
            var cup = new Cup();

            cup.AddDie(Die.D4());
            cup.Modifier = 20;
            Assert.GreaterOrEqual(cup.Roll(), 20);
        }
Esempio n. 3
0
 public void GetProperSidesOfDefaultDie()
 {
     Assert.AreEqual(DiceSides.d4, Die.D4().Sides);
     Assert.AreEqual(DiceSides.d6, Die.D6().Sides);
     Assert.AreEqual(DiceSides.d8, Die.D8().Sides);
     Assert.AreEqual(DiceSides.d10, Die.D10().Sides);
     Assert.AreEqual(DiceSides.d12, Die.D12().Sides);
     Assert.AreEqual(DiceSides.d20, Die.D20().Sides);
     Assert.AreEqual(DiceSides.d100, Die.D100().Sides);
 }
Esempio n. 4
0
        public void AnyTypeOfDieMayBeAddedToTheCup()
        {
            var cup = new Cup();

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

            Assert.AreEqual(new Die[] { Die.D4(), Die.D10(), Die.D6() }, cup.Dice);
        }
Esempio n. 5
0
 public void D4ReturnsAllSideValues()
 {
     ValidateAllSides(Die.D4());
     Assert.Pass();
 }