Exemple #1
0
        public void CheckWord_ReceiveLettersOnly_true()
        {
            ScrabbleScore newScore = new ScrabbleScore();
            bool          outcome  = newScore.CheckWord("word");

            Assert.AreEqual(true, outcome);
        }
    public static void Main()
    {
        Console.Clear();
        Console.ForegroundColor = ConsoleColor.DarkYellow;
        TypeLine("Please enter a word: (no numbers or special characters please)");
        string        inputWord = Console.ReadLine().ToLower();
        ScrabbleScore newScore  = new ScrabbleScore();

        bool isWord = newScore.CheckWord(inputWord);

        if (isWord)
        {
            int finalScore = newScore.GetScore(inputWord);
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.Cyan;
            TypeLine("Your Scrabble Score:");
            foreach (string detail in newScore.ScoreDetails)
            {
                TypeLine(detail);
            }
            TypeLine("Your final score is: " + finalScore + ".");
        }
        else
        {
            Console.Clear();
            ErrorMessage();
        }
    }