Пример #1
0
        public void RepeatWordCounter_ChangesNumberProperty_CheckNumbs()
        {
            RepeatWordCounter newCounter = new RepeatWordCounter("Hello", "Hel3lo Th3ere");

            newCounter.CheckNums();
            Assert.AreEqual(newCounter.Numbers, false);
        }
Пример #2
0
        public static void Main()
        {
            Console.WriteLine("Welcome to the Word Test");
            Console.WriteLine("Please input a sentance");
            string userSentence = Console.ReadLine();

            Console.WriteLine("Please input what word you would like to check");
            string            userWord   = Console.ReadLine();
            RepeatWordCounter newCounter = new RepeatWordCounter(userWord, userSentence);

            Console.WriteLine($"your word appears {newCounter.SentenceCheckWord()} times in your sentance");
        }
Пример #3
0
        public void RepeatWordCounterConstructor_TakesAStringAsParameterAndReturnsItLowerCase_RepeatWordCounter()
        {
            RepeatWordCounter newCounter = new RepeatWordCounter("Hello", "Hello There");

            Assert.AreEqual(newCounter.Word, "hello");
        }
Пример #4
0
        public void RepeatWordCounter_ChecksforNumbersinSentences_SentenceCheckNumbers()
        {
            RepeatWordCounter newCounter = new RepeatWordCounter("Hello", "Hel3lo Th3ere");

            Assert.AreEqual(newCounter.SentenceCheckNumbers(), false);
        }
Пример #5
0
        public void RepeatWordCounter_ChecksforNumbersinWords_WordCheckNumbers()
        {
            RepeatWordCounter newCounter = new RepeatWordCounter("Hel2lo1", "Hello There");

            Assert.AreEqual(newCounter.WordCheckNumbers(), false);
        }
Пример #6
0
        public void RepeatWordCounter_ReturnsCountofMatchingWordsinSentence_SentenceCheckWord()
        {
            RepeatWordCounter newCounter = new RepeatWordCounter("Hello", "Hello There Hello");

            Assert.AreEqual(newCounter.SentenceCheckWord(), 2);
        }
Пример #7
0
        // Test to check for Word input no longer vaild
        public void RepeatWordCounter_TakesSentenceAndMakesAnArray_SentenceCheckWord()
        {
            RepeatWordCounter newCounter = new RepeatWordCounter("Hello", "Hello There");

            Assert.AreEqual(newCounter.SentenceCheckWord(), "hello");
        }