Exemplo n.º 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]);
            };
        }
Exemplo n.º 2
0
        public void ScrabbleScorerTest1_SingleLetter_True()
        {
            ScrabbleScorer testScrabbleScorer = new ScrabbleScorer("p");

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

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