Beispiel #1
0
        public void ShouldReturnEmptyListIfThereAreNoAnagrams(List <string> words)
        {
            var anagramFinder = new AnagramFinder();

            var result = anagramFinder.FindAnagrams(words);

            Assert.Empty(result.Anagrams);
        }
Beispiel #2
0
        public void ShouldFindAnagrams(List <string> words)
        {
            var anagramFinder = new AnagramFinder();

            var result = anagramFinder.FindAnagrams(words);

            Assert.NotEmpty(result.Anagrams);
        }
Beispiel #3
0
        public void ShouldFindAnagramsAndItsNumbers(AnagramFinderTestData data)
        {
            var anagramFinder = new AnagramFinder();

            var result = anagramFinder.FindAnagrams(data.Words);

            Assert.Equal(data.AnagramCount, result.Anagrams.Count);
            Assert.Equal(data.LongestWordWithAnagramLength, result.GetLongestWordWithAnagram().Length);
        }
    public void Works(string s, string p, int[] expected)
    {
        IList <int> result = AnagramFinder.FindAnagrams(s, p);

        result.Should().BeEquivalentTo(expected);
    }