Example #1
0
        public void GetRollType_ValidatePossibilities()
        {
            var diceRoller = new DiceRoller(numberGenerator);

            Assert.AreEqual(RollType.normalRoll, diceRoller.GetRollType("d20 + 4"));
            Assert.AreEqual(RollType.withAdvantage, diceRoller.GetRollType("d20 + 4 adv"));
            Assert.AreEqual(RollType.withAdvantage, diceRoller.GetRollType("d20 + 4 /adv"));
            Assert.AreEqual(RollType.withAdvantage, diceRoller.GetRollType("d20 + 4 with advantage"));
            Assert.AreEqual(RollType.withDisadvantage, diceRoller.GetRollType("d20 + 4 dis"));
            Assert.AreEqual(RollType.withDisadvantage, diceRoller.GetRollType("d20 + 4 /dis"));
            Assert.AreEqual(RollType.withDisadvantage, diceRoller.GetRollType("d20 + 4 with disadvantage"));
            Assert.AreEqual(RollType.showUsage, diceRoller.GetRollType("/?"));
            Assert.AreEqual(RollType.showUsage, diceRoller.GetRollType("-?"));
            Assert.AreEqual(RollType.showUsage, diceRoller.GetRollType("help"));
        }