public ActionResult Results() { Anagramer newWord = new Anagramer(Request.Form["inputWord"]); List <string> result = newWord.GetValue(newWord.GetWord()); return(View(result)); }
static void Main(string[] args) { var fileName = @"C:\Users\l.dutrillaux\Documents\Kata\Anagrams\wordlist.txt"; var anagrammer = new Anagramer(); anagrammer.PrintAnagrams(fileName); }
public void GetValue2() { //Arrange Anagramer newWord = new Anagramer("alert"); var output = new List <string> { "alert", "alter", "later" }; //Act List <string> result = newWord.GetValue(newWord.GetWord()); //Assert CollectionAssert.AreEqual(result, output); }
public void GetValue() { //Arrange Anagramer newWord = new Anagramer("beast"); var output = new List <string> { "abets", "baste", "betas", "beast", "beats" }; //Act List <string> result = newWord.GetValue(newWord.GetWord()); //Assert CollectionAssert.AreEqual(result, output); }
public void GetAnagramsFromAshortUnsortedList() { var input = new List <string> { "kinship", "pinkish", "toto", "titi", "tata", "atat", "stink", "rots", "sort" }; var anagramer = new Anagramer(); var rawWords = anagramer.GetWords(input); var result = anagramer.GetAnagrams(rawWords).ToList(); Assert.IsTrue(result.Count() == 3); Assert.IsTrue(result.Contains("kinship pinkish")); Assert.IsTrue(result.Contains("tata atat")); Assert.IsTrue(result.Contains("rots sort")); }