コード例 #1
0
        public void CalculateScore_TestSpecialChar()
        {
            string     testString     = "!test!";
            CheckScore testCheckScore = new CheckScore(testString);

            testCheckScore.CalculateScore();
            Assert.AreEqual(4, testCheckScore.GetUserScore());
        }
コード例 #2
0
        public void CalculateScore_TestHigh()
        {
            string     testString     = "supercalifragilisticexpialidocious";
            CheckScore testCheckScore = new CheckScore(testString);

            testCheckScore.CalculateScore();
            Assert.AreEqual(56, testCheckScore.GetUserScore());
        }
コード例 #3
0
        public void CalculateScore_TestLow()
        {
            string     testString     = "test";
            CheckScore testCheckScore = new CheckScore(testString);

            testCheckScore.CalculateScore();
            Assert.AreEqual(4, testCheckScore.GetUserScore());
        }
コード例 #4
0
        public void CalculateScore_TestMid()
        {
            string     testString     = "quartz";
            CheckScore testCheckScore = new CheckScore(testString);

            testCheckScore.CalculateScore();
            Assert.AreEqual(24, testCheckScore.GetUserScore());
        }
コード例 #5
0
    public static void Main()
    {
        Console.WriteLine("Enter a word to check its Scrabble score.");
        string     userInput     = Console.ReadLine();
        CheckScore newCheckScore = new CheckScore(userInput);

        newCheckScore.CalculateScore();
        int myScore = newCheckScore.GetUserScore();

        Console.WriteLine("Your Scrabble score for the word " + newCheckScore.GetUserInput() + ": " + myScore + "!");
    }