Example #1
0
        public void GetReturnList_FetchTheReturnList_List()
        {
            //arrange
            string        fakeWord = "Bread";
            List <string> fakeList = new List <string> {
                "Bread", "Dreab", "Rad"
            };
            List <string> fakeReturnedList = new List <string> {
            };
            AnagramChecker newAnagram      = new AnagramChecker(fakeWord, fakeList);

            //act
            List <string> returnedList = newAnagram.GetReturnList();

            //assert
            CollectionAssert.AreEqual(returnedList, fakeReturnedList);
        }
Example #2
0
        public ActionResult Create()
        {
            string        userWord = Request.Form["user-word"];
            List <string> userList = new List <string> {
                Request.Form["list-word1"],
                Request.Form["list-word2"],
                Request.Form["list-word3"],
                Request.Form["list-word4"],
                Request.Form["list-word5"]
            };
            AnagramChecker newAnagram = new AnagramChecker(userWord, userList);

            newAnagram.SetReturnListPartial();
            List <string> returnList = newAnagram.GetReturnList();

            return(View("Index", returnList));
        }
Example #3
0
        public void SetReturnListPartial_SetTheReturnList_List()
        {
            //arrange
            string        fakeword = "Beard";
            List <string> fakeList = new List <string> {
                "Dreab", "Bread", "Rad", "cat"
            };
            List <string> returnList = new List <string> {
                "Dreab", "Bread", "Rad"
            };
            AnagramChecker newAnagram = new AnagramChecker(fakeword, fakeList);

            //act
            newAnagram.SetReturnListPartial();

            //assert
            CollectionAssert.AreEqual(returnList, newAnagram.GetReturnList());
        }