public void MultiplesOfTheSameDiceCanBeAdded() { var cup = new Cup(); cup.AddDice( Die.GetDice(DiceSides.d6, 4) ); Assert.AreEqual(new Die[] { Die.D6(), Die.D6(), Die.D6(), Die.D6() }, cup.Dice); }
public void ItRollsAllTheDiceWhenRollingTheCup() { var cup = new Cup(); cup.AddDie(Die.D6()); cup.AddDie(Die.D6()); cup.Roll(); Assert.IsTrue(cup.Dice.All(x => x.LastRoll > 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); }
public void ResultIsTheSumOfAllDiceRolled() { var cup = new Cup(); cup.AddDie(Die.D6()); cup.AddDie(Die.D6()); var result = cup.Roll(); Assert.AreEqual(result, cup.Dice.Sum(x => x.LastRoll)); }
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); }
public void FormatsCupIntoADiceString() { var cup = new Cup(); cup.AddDie(Die.D10()); Assert.AreEqual("1d10", cup.ToString()); cup.AddDie(Die.D10()); Assert.AreEqual("2d10", cup.ToString()); cup.Modifier = 5; Assert.AreEqual("2d10+5", cup.ToString()); cup.AddDie(Die.D6()); Assert.AreEqual("2d10+1d6+5", cup.ToString()); }
public void D6ReturnsAllSideValues() { ValidateAllSides(Die.D6()); Assert.Pass(); }
public void CupCanBeCreatedWithArrayOfDice() { var cup = new Cup(Die.GetDice(DiceSides.d6, 4)); Assert.AreEqual(new Die[] { Die.D6(), Die.D6(), Die.D6(), Die.D6() }, cup.Dice); }