Example #1
0
        public void TestDieSetRollDiceIndividually()
        {
            // create dice and set
            Die d1 = new Die();
            Die d2 = new Die();
            Die d3 = new Die();
            DiceSet set = new DiceSet();
            set.Add(d1);
            set.Add(d2);
            set.Add(d3);

            // roll dice individually
            d1.Roll();
            d2.Roll();
            d3.Roll();

            // add rolls of dice
            int total = d1.RollResult + d2.RollResult + d3.RollResult;

            // test that the set roll matches the individual dice
            Assert.AreEqual<int>(total, set.RollResult, "Dieset roll does not match total value of individually rolled dice.");
        }