コード例 #1
0
ファイル: BoardTests.cs プロジェクト: Fatme/King-Survival-4
 public void CheckIfAFigureIsAddedCorrectlyToTheBoard()
 {
     var board = new Board();
     var position = new Position(1, 1);
     var figure = new KingFigure();
     board.AddFigure(figure, position);
     Assert.AreEqual(figure, board.GetFigureAtPosition(position));
 }
コード例 #2
0
ファイル: BoardTests.cs プロジェクト: Fatme/King-Survival-4
        public void CheckIfGetFigureAtPositionWorkCorrectly()
        {
            var board = new Board();
            var figure = new KingFigure();
            board.AddFigure(figure, new Position(1, 1));
            var realFigure = board.GetFigureAtPosition(new Position(1, 1));

            Assert.AreEqual(figure, realFigure);
        }
コード例 #3
0
ファイル: BoardTests.cs プロジェクト: Fatme/King-Survival-4
        public void CheckIfGetFigureAtPositionReturnsTheCorrectFigure()
        {
            var board = new Board();
            var position = new Position(1, 1);
            var figure = new KingFigure();
            board.AddFigure(figure, position);

            Assert.AreEqual(figure, board.GetFigureAtPosition(position));
        }
コード例 #4
0
ファイル: BoardTests.cs プロジェクト: Fatme/King-Survival-4
        public void CheckIfAddFigureWorksCorrectlyWithCorrectFigureAndCorrectPosition()
        {
            var board = new Board();
            var position = new Position(3, 7);
            IFigure king = new KingFigure();

            board.AddFigure(king, position);
            Assert.AreSame(king, board.GetFigureAtPosition(position));
        }
コード例 #5
0
        public void CheckIfAFigureIsAddedCorrectlyToTheBoard()
        {
            var position = new Position(1, 1);

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

            var board = new Board();
            board.AddFigure(mockedFigure.Object, position);
            Assert.AreSame(mockedFigure.Object, board.GetFigureAtPosition(position));
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        public void CheckIfAddFigureWorksCorrectlyWithCorrectFigureAndCorrectPosition()
        {
            var board = new Board();
            var position = new Position(Constants.MaximumRowValueOnBoard / 2, Constants.MaximumColumnValueOnBoard / 2);

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

            var king = mockedFigure.Object;

            board.AddFigure(king, position);
            Assert.AreSame(king, board.GetFigureAtPosition(position));
        }
コード例 #8
0
        public void CheckIfGetFigureAtPositionWorkCorrectly()
        {
            var position = new Position(Constants.MaximumRowValueOnBoard / 2, Constants.MaximumColumnValueOnBoard / 2);

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

            var figure = mockedFigure.Object;

            var board = new Board();
            board.AddFigure(figure, position);
            var realFigure = board.GetFigureAtPosition(position);

            Assert.AreEqual(figure, realFigure);
        }
コード例 #9
0
        public void CheckIfGetFigureAtPositionReturnsTheCorrectFigure()
        {
            var position = new Position(1, 1);

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

            var figure = mockedFigure.Object;

            var board = new Board();
            board.AddFigure(figure, position);

            Assert.AreSame(figure, board.GetFigureAtPosition(position));
        }