Beispiel #1
0
 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);
 }
Beispiel #2
0
 public void IsWord_forWordNotEqualingSameWord_input1()
 {
     string input1 = "frog";
       string input2 = "superman";
       Anagram newAnagram = new Anagram(input1,input2);
       Assert.Equal(input1, newAnagram.CompareInputs());
 }
Beispiel #3
0
 public void IsWord_forWordEqualingSameWord_input1()
 {
     string input1 = "beard";
       string input2 = "beard";
       Anagram newAnagram = new Anagram(input1, input2);
       Assert.Equal(input1, newAnagram.CompareInputs());
 }
Beispiel #4
0
        public void IsWord_ForWordIsPartOfSameWord_input1()
        {
            string input1 = "hat";
              string input2 = "that";

              Anagram newAnagram = new Anagram(input1,input2);

              Assert.Equal(input1, newAnagram.CompareInputs());
        }
Beispiel #5
0
        public void IsWord_ForWordIsAnagramOfSameWord_input2()
        {
            string input1 = "and";
              string input2 = "dna";

              Anagram newAnagram = new Anagram(input1,input2);

              Assert.Equal(input2, newAnagram.CompareInputs());
        }
Beispiel #6
0
        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];
              };
        }
Beispiel #7
0
 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];
       };
 }
Beispiel #8
0
        public static void Main()
        {
            string        userInput = "";
            List <string> anagrams;

            userInput    = PromptUser();
            Anagram.Word = userInput;
            GatherWordList();
            anagrams = Anagram.GetAnagrams();
            DisplayAnagrams(anagrams);
        }
Beispiel #9
0
        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);
            }
        }
Beispiel #10
0
 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]);
     };
 }
Beispiel #11
0
        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();
        }
Beispiel #12
0
 public void WordMatcher_ForDogandGod_true()
 {
     Anagram newAnagram = new Anagram("Dog");
       bool matchWord = newAnagram.IsAnagram("God");
       Assert.Equal(true, matchWord);
 }