Beispiel #1
0
 public void CheckIfSaveMementoSavesBoardCorrectly()
 {
     var board = new Board();
     var figure = new KingFigure();
     board.AddFigure(figure, new Position(1, 1));
     var actual = board.SaveMemento();
     Assert.AreEqual(actual.Board.GetLength(1), board.NumberOfColumns);
 }
Beispiel #2
0
        public void CheckIfSaveMementoSavesBoardCorrectly()
        {
            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 actual = board.SaveMemento();
            Assert.AreEqual(actual.Board.GetLength(1), board.NumberOfColumns);
        }
Beispiel #3
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);
 }