Beispiel #1
0
 public HomeModule()
 {
     Get["/"] = _ => {
     return View["index.cshtml"];
       };
       Post["/results"] = _ => {
     Scrabble newScrabble = new Scrabble(Request.Form["user-word"]);
     return View["results.cshtml", newScrabble];
       };
       Get["/results"] = _ => {
     return View["index.cshtml"];
       };
 }
Beispiel #2
0
        /// <summary>
        /// Change the specified name and players.
        /// </summary>
        /// <param name='name'>
        /// Name.
        /// </param>
        /// <param name='players'>
        /// Players.
        /// </param>
        public void Change(string name, Scrabble.Player.Player[] players)
        {
            scoresTable.HideAll();
            for( int i=0; i < game.players.Length; i++) {
                if( typeof( Player.ComputerPlayer ) == game.players[i].GetType() )
                    scoreValues[ i ].Markup = game.players[i].Name + " <span size=\"smaller\">(CPU)</span>";
                else
                    scoreValues[ i ].Text = game.players[i].Name + "  ";
                scoreValues[ i+6 ].Text = string.Format( "{0}", game.players[i].Score );
            }

            scoresTable.ShowAll();
        }
Beispiel #3
0
 public void Complicated_word_scores_more()
 {
     Assert.That(Scrabble.Score("quirky"), Is.EqualTo(22));
 }
Beispiel #4
0
 public void Scores_other_very_short_word()
 {
     Assert.That(Scrabble.Score("f"), Is.EqualTo(4));
 }
Beispiel #5
0
 public void Null_scores_zero()
 {
     Assert.That(Scrabble.Score(null), Is.EqualTo(0));
 }
Beispiel #6
0
 public void Convenient_scoring()
 {
     Assert.That(Scrabble.Score("alacrity"), Is.EqualTo(13));
 }
Beispiel #7
0
 public void Complicated_word_scores_more()
 {
     Assert.Equal(22, Scrabble.Score("quirky"));
 }
 public void Dispose()
 {
     Scrabble.reset();
 }
Beispiel #9
0
 public void Scores_other_very_short_word()
 {
     Assert.Equal(4, Scrabble.Score("f"));
 }
Beispiel #10
0
 public void Simple_word_scores_the_number_of_letters()
 {
     Assert.Equal(6, Scrabble.Score("street"));
 }
Beispiel #11
0
 public void Scores_very_short_word()
 {
     Assert.Equal(1, Scrabble.Score("a"));
 }
Beispiel #12
0
 public void Null_scores_zero()
 {
     Assert.Equal(0, Scrabble.Score(null));
 }
Beispiel #13
0
 public void Whitespace_scores_zero()
 {
     Assert.Equal(0, Scrabble.Score(" \t\n"));
 }
Beispiel #14
0
 public void Empty_word_scores_zero()
 {
     Assert.That(Scrabble.Score(""), Is.EqualTo(0));
 }
Beispiel #15
0
 public void Scores_are_case_insensitive()
 {
     Assert.Equal(41, Scrabble.Score("OXYPHENBUTAZONE"));
 }
Beispiel #16
0
 /// <summary>
 /// Applies a Play to the tiles in SquaresList.
 /// Play parameter might need to be traced to its location once created.
 /// </summary>
 /// <param name="play">Receives a play and applys that to tiles.</param>
 public void AddPlayToBoard(Scrabble.Play play)
 {
 }
Beispiel #17
0
 public void Empty_word_scores_zero()
 {
     Assert.Equal(0, Scrabble.Score(""));
 }
Beispiel #18
0
 /// <summary>
 /// Sets the game.
 /// </summary>
 /// <param name='g'>
 /// G.
 /// </param>
 public void setGame( Scrabble.Game.Game g )
 {
     this.game = g;
 }
Beispiel #19
0
 public void Entire_alphabet()
 {
     Assert.Equal(87, Scrabble.Score("abcdefghijklmnopqrstuvwxyz"));
 }
        public ActionResult Create(string word)
        {
            Scrabble myCounter = new Scrabble(word);

            return(View("Index", myCounter));
        }
Beispiel #21
0
        public void ScrabbleInstance_InstanceOfScrabble_ScoreTotal()
        {
            Scrabble instanceOfScrabble = new Scrabble();

            Assert.AreEqual(typeof(Scrabble), instanceOfScrabble.GetType());
        }
 public void Scores_are_case_insensitive()
 {
     Assert.That(Scrabble.Score("MULTIBILLIONAIRE"), Is.EqualTo(20));
 }
Beispiel #23
0
        public void ScrabbleTester_ReturnScore_int()
        {
            int resultWord = Scrabble.GetScore("Hello");

            Assert.AreEqual(8, resultWord);
        }
Beispiel #24
0
 public void Whitespace_scores_zero()
 {
     Assert.That(Scrabble.Score(" \t\n"), Is.EqualTo(0));
 }
Beispiel #25
0
 public void Dispose()
 {
     Scrabble.ClearAll();
 }
Beispiel #26
0
 public void Scores_very_short_word()
 {
     Assert.That(Scrabble.Score("a"), Is.EqualTo(1));
 }
        public void TestSingleLowerLetter_Inputf_ReturnFour()
        {
            Scrabble scrabble = new Scrabble();

            Assert.AreEqual(4, scrabble.GetWordScore("f"));
        }
Beispiel #28
0
 public void Simple_word_scores_the_number_of_letters()
 {
     Assert.That(Scrabble.Score("street"), Is.EqualTo(6));
 }
        public void TestSpecialCharacters()
        {
            Scrabble scrabble = new Scrabble();

            Assert.AreEqual(33, scrabble.GetWordScore("H@xz0r3z"));
        }
Beispiel #30
0
 public void Scores_are_case_insensitive()
 {
     Assert.That(Scrabble.Score("OXYPHENBUTAZONE"), Is.EqualTo(41));
 }
        public void TestMultipleWordsHyphen()
        {
            Scrabble scrabble = new Scrabble();

            Assert.AreEqual(9, scrabble.GetWordScore("Apple-juice"));
        }
Beispiel #32
0
 public static void Init( Scrabble.Game.Game g )
 {
     game = g;
 }
 /// <summary>
 /// Asserts to players are equal after filtration for GameState.
 /// </summary>
 /// <param name="player1">Any player object</param>
 /// <param name="player2">Any other player object</param>
 private void AssertPlayerEqual(Scrabble.PlayerClass.Player player1, Scrabble.PlayerClass.Player player2)
 {
     Assert.IsTrue(player1.HasTurnPriority == player2.HasTurnPriority);
     Assert.IsTrue(player1.HasVotedToEndGame == player2.HasVotedToEndGame);
     Assert.IsTrue(player1.PlayerID == player2.PlayerID);
     Assert.IsTrue(player1.Score == player2.Score);
     Assert.IsTrue(player1.SkipCount == player2.SkipCount);
     Assert.IsTrue(player1.Username == player2.Username);
 }