Example #1
0
        public void CheckIfRestoreMementoRestoresBoardCorrectly()
        {
            var position = new Position(Constants.MaximumRowValueOnBoard / 2, Constants.MaximumColumnValueOnBoard / 2);

            Mock<IFigure> mockedFigure = new Mock<IFigure>();
            mockedFigure.Setup(r => r.DisplaySign).Returns("K");

            var board = new Board();
            board.AddFigure(mockedFigure.Object, position);
            var memento = board.SaveMemento();
            board.RestoreMemento(memento);
            Assert.AreEqual(memento.Board.GetLength(1), board.NumberOfColumns);
        }
Example #2
0
 public void CheckIfRestoreMementoRestoresBoardCorrectly()
 {
     var board = new Board();
     var figure = new KingFigure();
     board.AddFigure(figure, new Position(1, 1));
     var memento = board.SaveMemento();
     board.RestoreMemento(memento);
     Assert.AreEqual(memento.Board.GetLength(1), board.NumberOfColumns);
 }