Ejemplo n.º 1
0
        public void CompareWord_ReturnsTrueIfInputWordMatchesArrayWord_True()
        {
            string inputWord     = "word";
            string wordFromArray = "word";

            Assert.IsTrue(RepeatCounter.CompareWord(inputWord, wordFromArray));
        }
Ejemplo n.º 2
0
        public static void Main()
        {
            Console.WriteLine("Welcome to my word-counter project!");
            Console.WriteLine("Thank you for joining!");
            Console.WriteLine("--------------------------------");
            Console.WriteLine("Please enter a word:");
            string userWord = Console.ReadLine();

            Console.WriteLine("Please enter a sentence:");
            string userSentence = Console.ReadLine();
            int    finalCount   = RepeatCounter.CompareWord(userWord, userSentence);

            Console.WriteLine("Your final count is:" + finalCount);
            Console.WriteLine("Would you like to try again? [yes] [no]");
            string doAgain = Console.ReadLine();

            if (doAgain == "yes")
            {
                Main();
            }
            else
            {
                Console.WriteLine("Goodbye!");
            }
        }