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"]; }; }
/// <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(); }
public void Complicated_word_scores_more() { Assert.That(Scrabble.Score("quirky"), Is.EqualTo(22)); }
public void Scores_other_very_short_word() { Assert.That(Scrabble.Score("f"), Is.EqualTo(4)); }
public void Null_scores_zero() { Assert.That(Scrabble.Score(null), Is.EqualTo(0)); }
public void Convenient_scoring() { Assert.That(Scrabble.Score("alacrity"), Is.EqualTo(13)); }
public void Complicated_word_scores_more() { Assert.Equal(22, Scrabble.Score("quirky")); }
public void Dispose() { Scrabble.reset(); }
public void Scores_other_very_short_word() { Assert.Equal(4, Scrabble.Score("f")); }
public void Simple_word_scores_the_number_of_letters() { Assert.Equal(6, Scrabble.Score("street")); }
public void Scores_very_short_word() { Assert.Equal(1, Scrabble.Score("a")); }
public void Null_scores_zero() { Assert.Equal(0, Scrabble.Score(null)); }
public void Whitespace_scores_zero() { Assert.Equal(0, Scrabble.Score(" \t\n")); }
public void Empty_word_scores_zero() { Assert.That(Scrabble.Score(""), Is.EqualTo(0)); }
public void Scores_are_case_insensitive() { Assert.Equal(41, Scrabble.Score("OXYPHENBUTAZONE")); }
/// <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) { }
public void Empty_word_scores_zero() { Assert.Equal(0, Scrabble.Score("")); }
/// <summary> /// Sets the game. /// </summary> /// <param name='g'> /// G. /// </param> public void setGame( Scrabble.Game.Game g ) { this.game = g; }
public void Entire_alphabet() { Assert.Equal(87, Scrabble.Score("abcdefghijklmnopqrstuvwxyz")); }
public ActionResult Create(string word) { Scrabble myCounter = new Scrabble(word); return(View("Index", myCounter)); }
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)); }
public void ScrabbleTester_ReturnScore_int() { int resultWord = Scrabble.GetScore("Hello"); Assert.AreEqual(8, resultWord); }
public void Whitespace_scores_zero() { Assert.That(Scrabble.Score(" \t\n"), Is.EqualTo(0)); }
public void Dispose() { Scrabble.ClearAll(); }
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")); }
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")); }
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")); }
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); }