Пример #1
0
        public void BreakListIntoCharList_ReturnListofCharLists()
        {
            string        word      = "evil";
            string        listCheck = "big boy butts";
            List <string> big       = new List <string> {
                "b", "i", "g"
            };
            List <string> boy = new List <string> {
                "b", "o", "y"
            };
            List <string> butts = new List <string> {
                "b", "u", "t", "t", "s"
            };
            List <List <string> > listOfCharLists = new List <List <string> >()
            {
                big, boy, butts
            };
            AnagramGenerator newAnagramGenerator = new AnagramGenerator(word, listCheck);

            List <List <string> > newListOfLists = new List <List <string> > {
            };

            newAnagramGenerator.BreakString();
            // newAnagramGenerator.SplitCompareList();
            newListOfLists = newAnagramGenerator.GetSplitCompareList();

            for (int index = 0; index < newListOfLists.Count; index++)
            {
                CollectionAssert.AreEqual(listOfCharLists[index], newListOfLists[index]);
            }
        }
Пример #2
0
        public void SeperateListCheck_ReturnNewList()
        {
            string        word      = "evil";
            string        listCheck = "big boy";
            List <string> test      = new List <string> {
                "big", "boy"
            };
            AnagramGenerator newAnagramGenerator = new AnagramGenerator(word, listCheck);

            newAnagramGenerator.BreakString();
            List <string> newList = new List <string> {
            };

            newList = newAnagramGenerator.GetCompareList();

            CollectionAssert.AreEqual(newList, test);
        }