public ActionResult Count() { words newWords = new words(); newWords.SetParagraph(Request.Form["inputPara"]); newWords.SetWord(Request.Form["inputWord"]); newWords.Compare(); return(View("index", newWords.GetScore())); }
public void UserParagraph_GetParagraph_True() { //Arrange string newParagraph = "oh boy, i sure love pizza"; words newWords = new words(); //Act newWords.SetParagraph(newParagraph); string result = newWords.GetParagraph(); //Assert Assert.AreEqual(result, newParagraph); Console.WriteLine(result); }
public void UserParagraph_SplitParagraph_True() { //Arrange string newParagraph = "oh boy, i sure love pizza"; string[] array = { "oh", "boy,", "i", "sure", "love", "pizza" }; words newWords = new words(); //Act newWords.SetParagraph(newParagraph); newWords.GetParagraph(); string[] result = newWords.Split(); //Assert CollectionAssert.AreEqual(array, result); Console.WriteLine(result); }
public void UserParagraph_Compare_True() { //Arrange string newWord = "pizza"; string newParagraph = "oh boy, i sure love pizza"; words newWords = new words(); //Act newWords.SetWord(newWord); newWords.SetParagraph(newParagraph); string testWord = newWords.GetWord(); string[] testPara = newWords.Split(); int result = newWords.Compare(testWord, testPara); //Assert Assert.AreEqual(result, 1); }