public void CheckIfTheRemoveFigureMethodThrowsCorrectlyIndexOutOfRangeException() { var board = new Board(); var position = new Position(9, 9); var figureSign = FigureSign.K; var figure = new King(figureSign); board.RemoveFigure(figure, position); }
public void CheckIfRemoveFigureRemovesTheFigure() { var board = new Board(); var position = new Position(1, 1); var figureSign = FigureSign.K; var figure = new King(figureSign); board.AddFigure(figure, position); board.RemoveFigure(figure, position); Assert.AreNotEqual(figure, board.GetFigureAtPosition(position)); }
public void CheckIfTheRemoveFigureMethodThrowsCorrectlyInvalidPositionExceptionWhenPositionIsNotValid() { var board = new Board(); var position = new Position(Constants.MaximumColumnValueOnBoard + 2, Constants.MaximumColumnValueOnBoard + 2); Mock<IFigure> mockedFigure = new Mock<IFigure>(); mockedFigure.Setup(r => r.DisplaySign).Returns("K"); var figure = mockedFigure.Object; board.RemoveFigure(position); }
public void CheckIfRemoveFigureRemovesTheFigure() { var board = new Board(); var position = new Position(1, 1); Mock<IFigure> mockedFigure = new Mock<IFigure>(); mockedFigure.Setup(r => r.DisplaySign).Returns("K"); var figure = mockedFigure.Object; board.AddFigure(figure, position); board.RemoveFigure(position); Assert.AreNotSame(figure, board.GetFigureAtPosition(position)); }
public void CheckIfTheRemoveFigureMethodThrowsCorrectlyNullReferenceExeption() { var board = new Board(); var position = new Position(1, 1); IFigure figure = null; board.RemoveFigure(figure, position); }