Example #1
0
        public void Returns_the_correct_count_of_dice_for_complex_strings(
            string input,
            int expectedCount
            )
        {
            var result = DiceParser.GetDice(input);

            Assert.Equal(expectedCount, result.Count());
        }
Example #2
0
        static void Main(string[] args)
        {
            var input = string.Join(",", args);

            Console.WriteLine($"input: {input}");
            var dice = DiceParser.GetDice(input).ToList();

            Console.WriteLine($"number of dice: {dice?.Count}");
            var result = DiceParser.RollDice(dice);

            Console.WriteLine($"result: {result}");

            Console.WriteLine();
        }
Example #3
0
        public void Can_parse_null()
        {
            var result = DiceParser.GetDice(null);

            Assert.NotNull(result);
        }
Example #4
0
        public void Can_parse_empty_string()
        {
            var result = DiceParser.GetDice("");

            Assert.NotNull(result);
        }