示例#1
0
        public void test_two_letter_word_fact_dict()
        {
            var dictionaryReader = new DictionaryReader();

            var anagramS = new AnagramSearcher(dictionaryReader);

            var l = anagramS.Transform("bca");

            l.Should().BeEquivalentTo(new List<string>() { "abc", "bca" });
        }
示例#2
0
        public void test_two_letter_word_fact_dict_b()
        {
            var dictionaryReader = new DictionaryReader();

            var anagramS = new AnagramSearcher(dictionaryReader);

            var l = anagramS.Transform("1234");

            l.Should().BeEquivalentTo(new List<string>{"1234","1243","1324","1342","1423","1432","2134","2143","2314","2341","2431","2413","4123","4132","4213","4231","4312","4321","3124","3142","3214","3241","3412","3421" });
        }
示例#3
0
        public void test_test_non_existent_file()
        {
            var dictionaryReader = new DictionaryReader("c:\\111");

            var words = dictionaryReader.GetDictionary();

            words.Should().BeEmpty();
        }
示例#4
0
        public void test_finding_string()
        {
            var dictionaryReader = new DictionaryReader("c:\\dicttest.txt");

            var words = dictionaryReader.GetDictionary();

            words.Should().BeEquivalentTo(new List<string> {"123", "132", "1234", "1456", "abcd", "window", "store", "hello"});
        }