Пример #1
0
 public void IsAnagram_ForBigWord_true()
 {
     Anagram testWord = new Anagram();
       List<string> testList= testWord.IsAnagram("beard", "bread beard egg butter");
       foreach(string i in testList)
       {
     Console.WriteLine(i);
     Console.WriteLine(testList.Count);
       }
       Assert.Equal(testList, testWord.IsAnagram("beard", "bread beard egg butter"));
 }
Пример #2
0
        public HomeModule()
        {
            Get["/"] = _ => {
            return View["index.cshtml"];
              };
              Post["/results"] = _ => {
            Anagram newAnagram = new Anagram();
            string word1 = Request.Form["anagram-word"];
            string word2 = Request.Form["anagram-list"];
            List<string> anagramList = newAnagram.IsAnagram(word1, word2);
            Console.WriteLine(word2);
            foreach (string i in anagramList)
            {
              Console.WriteLine(i);
            }

            return View["results.cshtml", anagramList];
              };
        }
Пример #3
0
 public void IsAnagram_ForTwoLetters_true()
 {
     Anagram testWord = new Anagram();
       List<string> testList= testWord.IsAnagram("ab", "ba");
       Assert.Equal(testList, testWord.IsAnagram("ab", "ba"));
 }
Пример #4
0
 public void IsAnagram_ForSingleLetter_true()
 {
     Anagram testWord = new Anagram();
       List<string> testList= testWord.IsAnagram("a", "a");
       Assert.Equal(testList, testWord.IsAnagram("a", "a"));
 }