public void CountWord_ReturnWordsInSentence_2()
        {
            RepeatCounter testRepeatCounter = new RepeatCounter("jahmanz", "jahmanz is jahmanz");
            int           countWords        = testRepeatCounter.CountWords();

            Assert.AreEqual(2, countWords);
        }
        public void CountWord_ReturnOneWord_1()
        {
            RepeatCounter testRepeatCounter = new RepeatCounter("jahmanz", "jahmanz");
            int           countWords        = testRepeatCounter.CountWords();

            Assert.AreEqual(1, countWords);
        }
        public void CountWord_ReturnOneLetter_1()
        {
            RepeatCounter testRepeatCounter = new RepeatCounter("a", "a");
            int           countWords        = testRepeatCounter.CountWords();

            Assert.AreEqual(1, countWords);
        }
        public void CaseChecker_ChangeToLowerCase_Count()
        {
            string        word              = "tEst";
            string        sentence          = "TeSt for testing occurrances of TEST.";
            RepeatCounter testRepeatCounter = new RepeatCounter(word, sentence);

            Assert.AreEqual(2, testRepeatCounter.CountWords());
        }
        public void WordCounter_ReturnNumberOfRepeatedWords_CountInt()
        {
            string word     = "test";
            string sentence = "this test is for testing how many times test appears";

            RepeatCounter testRepeatCounter = new RepeatCounter(word, sentence);

            Assert.AreEqual(2, testRepeatCounter.CountWords());
        }
Esempio n. 6
0
        public void CompareSententceAndWord_String()
        {
            RepeatCounter newCounterTest = new RepeatCounter("hello", "hello there friend");

            newCounterTest.CountWords();

            Assert.AreEqual(1, newCounterTest.GetInstance());

            // Console.WriteLine(_instance.ToString());
        }
        public void GetCount_ReturnsCount_Int()
        {
            // Arrange
            string        word             = "cat";
            string        sentence         = "I like my cat";
            RepeatCounter newRepeatCounter = new RepeatCounter(word, sentence);

            // Act
            int result = newRepeatCounter.CountWords();

            // Assert
            Assert.AreEqual(1, result);
        }