I am trying to do practice TDD using small kata. Kata is to find the anagram pairs in the given file input. I tried to do
the same and write some
test cases. Any idea?
Anagrams: An anagram is a type of
word play, the result of rearranging the letters of a word or phrase to produce a new
word or phrase, using all the original letters exactly once.
Input is file in which each line has a single word. Each word is going to compare another
words present in the file to find whether word is anagram or not.
A word is anagram when its having following scenarios so it makes my test cases as well:
1) should be of same length
2) should contains only alphabets
3) should contains characters exactly same and be used only once
4) should not match null or spaces
5) Should print all the anagram pairs present in the input
6) Should remove already matched words to avoid check again and improve performance