public void SentenceMatcher_ForDogandGod_true() { Anagram newAnagram = new Anagram("Dog"); List<string> returnList = newAnagram.printAnagram("God is awesome, dog"); List<string> testList = new List<string> {"God", "dog"}; Assert.Equal(testList, returnList); }
public void IsWord_forWordNotEqualingSameWord_input1() { string input1 = "frog"; string input2 = "superman"; Anagram newAnagram = new Anagram(input1,input2); Assert.Equal(input1, newAnagram.CompareInputs()); }
public void IsWord_forWordEqualingSameWord_input1() { string input1 = "beard"; string input2 = "beard"; Anagram newAnagram = new Anagram(input1, input2); Assert.Equal(input1, newAnagram.CompareInputs()); }
public void IsWord_ForWordIsPartOfSameWord_input1() { string input1 = "hat"; string input2 = "that"; Anagram newAnagram = new Anagram(input1,input2); Assert.Equal(input1, newAnagram.CompareInputs()); }
public void IsWord_ForWordIsAnagramOfSameWord_input2() { string input1 = "and"; string input2 = "dna"; Anagram newAnagram = new Anagram(input1,input2); Assert.Equal(input2, newAnagram.CompareInputs()); }
public HomeModule() { Get["/"] = _ => View ["index.cshtml"]; Post["/"] = _ => { Anagram newAnagram = new Anagram(Request.Form["word"]); List<string> returnList = newAnagram.printAnagram(Request.Form["listWords"]); return View["index.cshtml", returnList]; }; }
public HomeModule() { Get["/"] = _ => View["index.cshtml"]; Post["/printout"] = _ => { Anagram AnagramObject = new Anagram(Request.Form["inputNumberOne"], Request.Form["inputNumberTwo"]); string newString = AnagramObject.CompareInputs(); return View["printout.cshtml", newString]; }; }
public static void Main() { string userInput = ""; List <string> anagrams; userInput = PromptUser(); Anagram.Word = userInput; GatherWordList(); anagrams = Anagram.GetAnagrams(); DisplayAnagrams(anagrams); }
public static void GatherWordList() { string userInput = ""; Console.WriteLine("Enter words one at a time to compare against. Enter 'Q' when done."); while (userInput != "q") { userInput = Console.ReadLine().ToLower(); Anagram.Add(userInput); } }
public HomeModule() { Get["/"] = _ => { return(View["index.cshtml"]); }; Post["/result_form"] = _ => { List <string> newList = new List <string> { Request.Form["anagram-one"], Request.Form["anagram-two"] }; Anagram newAnagram = new Anagram(Request.Form["user-word"], newList); List <string> finalResults = newAnagram.FindAnagrams(); return(View["result.cshtml", finalResults]); }; }
public static void Main(string[] args) { var wordsArr = new[] { "arm", "tar", "bare", "rat", "tea", "eat", "bear", "ram" }; Console.WriteLine("***Words array*** \n"); foreach (var word in wordsArr) { Console.Write(word + " "); } Console.WriteLine("\n\n***Anagram Words Result**** \n"); Anagram.PrintAnagramWords(wordsArr); Console.ReadKey(); }
public void WordMatcher_ForDogandGod_true() { Anagram newAnagram = new Anagram("Dog"); bool matchWord = newAnagram.IsAnagram("God"); Assert.Equal(true, matchWord); }