public ActionResult Result() { string word = Request.Form[("keyWord")]; string sentence = Request.Form[("sentence")]; WordCheckerVariable wordCheckerVariable = new WordCheckerVariable(word, sentence); return(View("Result", wordCheckerVariable)); }
public void GetSentence_ReturnSentenced_String() { //Arrange string sentence = "This is a sentence."; WordCheckerVariable WordCheckerInst = new WordCheckerVariable("", sentence); //Act string sentenceResult = WordCheckerInst.GetSentence(); //Assert Assert.AreEqual(sentence, sentenceResult); }
public void GetKeyWord_ReturnKeyWord_String() { //Arrange string word = "word"; WordCheckerVariable WordCheckerInst = new WordCheckerVariable(word, ""); //Act string keyWordResult = WordCheckerInst.GetKeyWord(); //Assert Assert.AreEqual(word, keyWordResult); }
public void GetCount_GetZeroCount_Int() { //Arrange string keyWord = "sentence"; string sentence = "This is a fail test."; WordCheckerVariable WordCheckerInst = new WordCheckerVariable(keyWord, sentence); //Act int result = WordCheckerInst.GetCountInt(); //Assert Assert.AreEqual(0, result); }