コード例 #1
0
        public void Not_capture_pawn_aside(char attackCol, int attackRow, char defCol, int defRow)
        {
            var bishopPostions = new PiecePostition(attackCol, attackRow);
            var pawnPostions   = new PiecePostition(defCol, defRow);
            var sut            = new PieceCapture(bishopPostions);

            Assert.False(sut.IsCapture(pawnPostions));
        }
コード例 #2
0
        public void Detect_pawn_capture_when_in_any_diagonal(char attackCol, int attackRow, char defCol, int defRow)
        {
            var bishopPostions = new PiecePostition(attackCol, attackRow);
            var pawnPostions   = new PiecePostition(defCol, defRow);
            var sut            = new PieceCapture(bishopPostions);

            Assert.True(sut.IsCapture(pawnPostions));
        }
コード例 #3
0
        public void Not_capture_pawn_in_front()
        {
            var bishopPostions = new PiecePostition('H', 1);

            var pawnPostions = new PiecePostition('H', 3);
            var sut          = new PieceCapture(bishopPostions);

            Assert.False(sut.IsCapture(pawnPostions));
        }
コード例 #4
0
 public PieceCapture(PiecePostition attackerPosition) =>
 (AttackerPosition) = (attackerPosition);