public void ShowPlayerTrueTest() { IPlayer player = new Player(); ILabyrinth labyrinth = new SquareLabyrinth(); this.FillDiamondMatrix(labyrinth); player.ShowPlayer(labyrinth); Assert.IsTrue(labyrinth.Matrix[player.Coordinates.Row, player.Coordinates.Col] == (char)Symbol.Player); }
public void RemovePlayerTrueTest() { IPlayer player = new Player(); ILabyrinth labyrinth = new SquareLabyrinth(); this.FillDiamondMatrix(labyrinth); player.RemovePlayer(labyrinth); Assert.IsTrue(labyrinth.Matrix[player.Coordinates.Row, player.Coordinates.Col] == '\0'); }
public void SquareLabyrinthFillMatrixTest() { var charGeneratorMock = new Mock <IRandomCharProvider>(); bool isFilled = false; charGeneratorMock.Setup( x => x.GetRandomSymbol(It.IsAny <int>())).Callback( () => { isFilled = true; }); var squareLabyrinth = new SquareLabyrinth(); squareLabyrinth.FillMatrix(charGeneratorMock.Object); Assert.IsTrue(isFilled, "Pentagon labyrinth matrix should be filled."); }