Esempio n. 1
0
        public void Returns_null_if_no_solution(string input)
        {
            var dictionary = new HashSet <string> {
                "ab", "d", "bc"
            };

            var greedyWords = new GreedyWords(dictionary);

            Assert.That(greedyWords.GetWords(input), Is.Null);
        }
Esempio n. 2
0
        public void Returns_correct_words_matched_greedily
            (string input, params string[] expected)
        {
            var dictionary = new HashSet <string>
            {
                "he", "hell", "hello", "low", "or", "world",
                "the", "quick", "bro", "brow", "brown", "own", "owner",
                "fox", "ox", "jump", "jumps", "over", "overt", "la",
                "lazy", "do", "dog", "nerd"
            };

            var greedyWords = new GreedyWords(dictionary);

            Assert.That(greedyWords.GetWords(input), Is.EqualTo(expected));
        }