예제 #1
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));
        }
예제 #2
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());
        }