public void PlayerOneScoresTwoTimes() { var board = new TennisBoard("X", "Y"); board.Player1Scores(); board.Player1Scores(); Assert.AreEqual("30 - 0", board.Result); }
public void PlayerTwoScoresThreeTimes() { var board = new TennisBoard("X", "Y"); board.Player2Scores(); board.Player2Scores(); board.Player2Scores(); Assert.AreEqual("0 - 40", board.Result); }
public ViewResult Start(string player1, string player2) { if (String.IsNullOrWhiteSpace(player1)) { ViewBag.ErrorMessage = "You should input a name for the first player"; return View("Index"); } if (String.IsNullOrWhiteSpace(player2)) { ViewBag.ErrorMessage = "You should input a name for the second player"; return View("Index"); } var board = new TennisBoard(player1, player2); _sessionStore["Game"] = board; ViewBag.Title = board.Title; ViewBag.Result = board.Result; return View("Game"); }
public void GameStartsInZero() { var board = new TennisBoard("X", "Y"); Assert.AreEqual("0 - 0", board.Result); }
public void BoardTitleWithPlayerNames() { var board = new TennisBoard("Federer", "Nadal"); Assert.AreEqual("Federer vs Nadal", board.Title); }
public void BoardTitleWithOtherPlayerNames() { var board = new TennisBoard("Rios", "Nalbandian"); Assert.AreEqual("Rios vs Nalbandian", board.Title); }