public void Count_ReturnCount_Int()
        {
            string           word      = "hi";
            string           sentence  = "hi Hi";
            WordCounterClass testCheck = new WordCounterClass(word, sentence);
            int result = testCheck.Count();

            Assert.AreEqual(2, result);
        }
        public void CheckIfEmpty_ChecksUserInput_False()
        {
            string           word     = "not";
            string           sentence = "empty";
            WordCounterClass test     = new WordCounterClass(word, sentence);

            bool result = test.CheckIfEmpty();

            Assert.AreEqual(false, result);
        }
        public void GetSentence_ReturnsSentence_String()
        {
            //Arrange
            string           sentence    = "hello hello";
            WordCounterClass newSentence = new WordCounterClass("", sentence);
            //Act
            string result = newSentence.GetSentence();

            //Assert
            Assert.AreEqual(sentence, result);
        }
        public void GetWord_ReturnsWord_String()
        {
            //Arrange
            string           word    = "hello";
            WordCounterClass newWord = new WordCounterClass(word, "");
            //Act
            string result = newWord.GetWord();

            //Assert
            Assert.AreEqual(word, result);
        }
        public void WordConstructor_CreatesInstanceOfWord_Word()
        {
            WordCounterClass newWord = new WordCounterClass("hi", "");

            Assert.AreEqual(typeof(WordCounterClass), newWord.GetType());
        }
Exemple #6
0
        public ActionResult Create(string word, string sentence)
        {
            WordCounterClass newCount = new WordCounterClass(word, sentence);

            return(View("Index", newCount));
        }