public void ShouldReturnZeroWhenHaveEmptyList() { this.scoreboard = new Scoreboard(); var actual = this.scoreboard.Players.Count; var expected = 0; Assert.AreEqual(expected, actual); }
/// <summary> /// Initializes a new instance of the <see cref="LabyrinthEngine" /> class. /// </summary> /// <param name="renderer">>Object to print.</param> /// <param name="userInterface">Interacting with user.</param> /// <param name="initializer">Initializing the game.</param> /// <param name="player">The player</param> /// <param name="grid">The play field</param> public LabyrinthEngine(IRenderer renderer, IUserInterface userInterface, IInitializer initializer, IPlayer player, IGrid grid) : base(initializer) { this.renderer = renderer; this.userInterface = userInterface; this.scoreBoard = new Scoreboard(); this.player = player; this.grid = grid; this.gridMemory = new GridMemory(); }
public void ShouldAddPlayerWithNameToList() { this.scoreboard = new Scoreboard(); this.player = new Player("Stamat"); this.scoreboard.AddPlayer(this.player); var expected = this.player.Name; var actual = this.scoreboard.Players.FirstOrDefault().Name; Assert.AreEqual(expected, actual); }
public void ShouldAddPlayerToList() { this.scoreboard = new Scoreboard(); this.player = new Player(); this.scoreboard.AddPlayer(this.player); var actual = this.scoreboard.Players.Count; var expected = 1; Assert.AreEqual(expected, actual); }
/// <summary> /// Prints high score on the console /// </summary> /// <param name="scoreboard">IList where is saved scores</param> public void PrintScore(Scoreboard scoreboard) { int counter = 1; if (scoreboard.Players.Count <= 0) { Console.WriteLine(GameMassages.EmptyScoreBoardMessage); } foreach (Player player in scoreboard) { Console.WriteLine("{0}| {1} --> {2}", counter, player.Name, player.MoveCount); counter++; } }