Ejemplo n.º 1
0
        public void AnagramChecker_CheckIfSameLetters_True()
        {
            List <string> optionList = new List <string> {
                "wrod", "worde", "some"
            };
            UserInput     newUserInput = new UserInput("word", optionList);
            List <string> tempList     = new List <string> {
                "wrod"
            };

            newUserInput.LengthChecker();
            newUserInput.AnagramChecker(newUserInput.LengthList);
            CollectionAssert.AreEqual(tempList, UserInput.GetAll());
        }
Ejemplo n.º 2
0
        public void AnagramChecker_CheckForSingleLetterMatches_Act()
        {
            // Arrange
            string        string1 = "cat";
            List <string> list1   = new List <string> {
                "act"
            };
            UserInput newUserInput = new UserInput(string1, list1);

            // Act
            List <string> anagramList = newUserInput.AnagramChecker();

            // Assert
            CollectionAssert.AreEqual(list1, anagramList);
        }
Ejemplo n.º 3
0
        public void AnagramChecker_CheckForNonAnagrams_Lives()
        {
            // Arrange
            string        string1 = "elvis";
            List <string> list1   = new List <string> {
                "lives", "Priscilla", "toilet", "pickles"
            };
            UserInput     newUserInput = new UserInput(string1, list1);
            List <string> expectedList = new List <string> {
                "lives"
            };

            // Act
            List <string> anagramList = newUserInput.AnagramChecker();

            foreach (string item in anagramList)
            {
                Console.WriteLine(item);
            }
            // Assert
            CollectionAssert.AreEqual(expectedList, anagramList);
        }