コード例 #1
0
        public void ParseTest()
        {
            var input = "1d6";
            var dices = _diceFactory.ParseDungeonAndDragonsDice(input).ToList();

            Assert.AreEqual(1, dices.Count());
            var first = dices[0];

            Assert.IsInstanceOfType(first, typeof(Dice));
            var firstDice = first as Dice;

            Assert.AreEqual(6, firstDice.SideCount);
            Assert.IsFalse(firstDice.IsNegative);
        }