public void GetPhrase_ReturnsPhrase_String()
        {
            string phrase      = "word word word";
            string checkedWord = "word";
            Phrase newPhrase   = new Phrase(phrase, checkedWord);
            string result      = newPhrase.GetPhrase();
            string resultWord  = newPhrase.GetWord();

            Assert.AreEqual(result, phrase);
            Assert.AreEqual(resultWord, checkedWord);
        }
Ejemplo n.º 2
0
        public ActionResult Create(string sentence, string checkedword)
        {
            Phrase newphrase  = new Phrase(sentence, checkedword);
            string userPhrase = newphrase.GetPhrase().ToLower();
            bool   numPhrase  = newphrase.HasNum(userPhrase);

            newphrase.RemoveNum();
            string userWord  = newphrase.GetWord().ToLower();
            int    wordCount = newphrase.CheckRepeatedWord();

            return(View("Index", newphrase));
        }
        public void SetPhrase_SetsThePhrase_String()
        {
            string userPhrase  = "word word word";
            string checkedWord = "word";
            Phrase newPhrase   = new Phrase(userPhrase, checkedWord);


            string updatedPhrase = "another phrase";
            string updatedWord   = "another word";

            newPhrase.SetString(updatedPhrase);
            newPhrase.SetWord(updatedWord);
            string result     = newPhrase.GetPhrase();
            string resultWord = newPhrase.GetWord();

            Assert.AreEqual(updatedPhrase, result);
            Assert.AreEqual(updatedWord, resultWord);
        }