Пример #1
0
        public void Generate_Boaster_ReturnsBoatersBorates()
        {
            var sut = new AnagramProvider(new FileDictionaryProvider());

            IEnumerable<string> result = sut.Generate("boaster");

            result.ShouldContainItems(new[] {"boaters", "borates"});
        }
Пример #2
0
        public void Generate_WordNotInDictionary_ReturnsEmpty()
        {
            IDictionaryProvider dictionary =
                Mock.Of<IDictionaryProvider>(d => d.GetWords() == new[] { "Fresher", "Refresh" });
            var sut = new AnagramProvider(dictionary);

            IEnumerable<string> result = sut.Generate("jklasdgfjklsdgfjklsdgf");

            result.ShouldBeEmpty();
        }
Пример #3
0
        public void Generate_Fresher_ReturnsRefresh()
        {
            IDictionaryProvider dictionary =
                Mock.Of<IDictionaryProvider>(d => d.GetWords() == new[] {"Fresher", "Refresh"});
            var sut = new AnagramProvider(dictionary);

            IEnumerable<string> result = sut.Generate("Fresher");

            result.ShouldMatch("Refresh");
        }