Example #1
0
        public ActionResult Result()
        {
            string word     = Request.Form[("keyWord")];
            string sentence = Request.Form[("sentence")];
            WordCheckerVariable wordCheckerVariable = new WordCheckerVariable(word, sentence);

            return(View("Result", wordCheckerVariable));
        }
Example #2
0
        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);
        }
Example #3
0
        public void GetKeyWord_ReturnKeyWord_String()
        {
            //Arrange
            string word = "word";
            WordCheckerVariable WordCheckerInst = new WordCheckerVariable(word, "");
            //Act
            string keyWordResult = WordCheckerInst.GetKeyWord();

            //Assert
            Assert.AreEqual(word, keyWordResult);
        }
Example #4
0
        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);
        }