Beispiel #1
0
        public HomeModule()
        {
            Get["/"] = _ =>
            {
                return(View["index.cshtml"]);
            };

            Post["/score"] = _ =>
            {
                ScrabbleScorer newScrabbleScorer = new ScrabbleScorer(Request.Form["user-word"]);
                int            score             = newScrabbleScorer.GetScore();
                return(View["index.cshtml", score]);
            };
        }
        public void ScrabbleScorerTest1_SingleLetter_True()
        {
            ScrabbleScorer testScrabbleScorer = new ScrabbleScorer("p");

            Assert.Equal(3, testScrabbleScorer.GetScore());
        }
        public void ScrabbleScorerTest2_WholeWord_True()
        {
            ScrabbleScorer testScrabbleScorer = new ScrabbleScorer("cat");

            Assert.Equal(5, testScrabbleScorer.GetScore());
        }