예제 #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());
        }
예제 #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();
        }
예제 #3
0
        public void Can_parse_null()
        {
            var result = DiceParser.GetDice(null);

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

            Assert.NotNull(result);
        }