Exemplo n.º 1
0
        public void CheckIfNonLettersOrEmpty_ReturnFalseIfNotEmptyAndOnlyLetterCharacters_False()
        {
            Scrabble newWord = new Scrabble("hello");
            bool     result  = newWord.CheckIfNonLettersOrEmpty();

            Assert.AreEqual(false, result);
        }
Exemplo n.º 2
0
        public static void AskForWordInput()
        {
            Console.WriteLine("Please enter a word containing only letter characters. Multiple words cannot be used.");
            string   userWord        = Console.ReadLine();
            Scrabble scrabble        = new Scrabble(userWord);
            bool     ismultipleWords = scrabble.CheckIfMultipleWords();

            if (ismultipleWords)
            {
                Error();
                AskForWordInput();
            }
            else
            {
                bool isScoreZero = scrabble.CheckIfNonLettersOrEmpty();
                if (isScoreZero)
                {
                    Console.WriteLine("Score is equal to 0.");
                }
                else
                {
                    int score = scrabble.CalculateScore();
                    Console.WriteLine("The score value for your word is:");
                    Console.WriteLine(score);
                }
            }
        }
Exemplo n.º 3
0
        public void CheckIfNonLettersOrEmpty_ReturnTrueIfEmptyOrNonLetterCharacters_True()
        {
            Scrabble newWord = new Scrabble("425");
            bool     result  = newWord.CheckIfNonLettersOrEmpty();

            Assert.AreEqual(true, result);
        }