Repository: thomas-mauran/chess-tui (language: rust)

Issue:
Refactor the tests in separate files
### Problem

Currently the test are getting too big especially in the board.rs file we need to split that.

---

### Proposed Refactor Plan

Create a separate test/ folder for the tests

---

### Expected Benefits

- Making tests way easier to maintain and implement
- Easily have a quick overview of the parts of the code which are covered by tests
---



Discussion / hints:

Fix patch:
diff --git a/src/board.rs b/src/board.rs
index 6f52afd..91f2138 100644
--- a/src/board.rs
+++ b/src/board.rs
@@ -838,7 +838,7 @@ impl Board {
     }
 
     // Check if the latest move is a promotion
-    fn is_latest_move_promotion(&self) -> bool {
+    pub fn is_latest_move_promotion(&self) -> bool {
         if let Some(last_move) = self.move_history.last() {
             if let Some(piece_type_to) =
                 get_piece_type(self.board, &Coord::new(last_move.to.row, last_move.to.col))
@@ -1183,1002 +1183,3 @@ impl Board {
         );
     }
 }
-
-#[cfg(test)]
-mod tests {
-    use crate::{
-        board::{Board, Coord},
-        pieces::{PieceColor, PieceMove, PieceType},
-        utils::is_getting_checked,
-    };
-
-    #[test]
-    fn is_getting_checked_true() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        assert!(is_getting_checked(custom_board, PieceColor::White, &[]));
-    }
-
-    #[test]
-    fn is_getting_checked_false() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        assert!(!is_getting_checked(custom_board, PieceColor::White, &[]));
-    }
-
-    #[test]
-    fn is_getting_checked_piece_in_front_false() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Queen, PieceColor::Black)),
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Queen, PieceColor::White)),
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                None,
-                Some((PieceType::King, PieceColor::White)),
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        assert!(!is_getting_checked(custom_board, PieceColor::Black, &[]));
-    }
-
-    #[test]
-    fn is_getting_checked_piece_in_with_gap_false() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Queen, PieceColor::Black)),
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Queen, PieceColor::White)),
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                None,
-                Some((PieceType::King, PieceColor::White)),
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        assert!(!is_getting_checked(custom_board, PieceColor::Black, &[]));
-    }
-
-    #[test]
-    fn is_checkmate_true() {
-        let custom_board = [
-            [
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                Some((PieceType::Queen, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let board = Board::new(custom_board, PieceColor::White, vec![]);
-
-        assert!(board.is_checkmate());
-    }
-
-    #[test]
-    fn is_checkmate_false() {
-        let custom_board = [
-            [
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let board = Board::new(custom_board, PieceColor::White, vec![]);
-
-        assert!(!board.is_checkmate());
-    }
-
-    #[test]
-    fn is_checkmate_false_2() {
-        let custom_board = [
-            [
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-                None,
-            ],
-            [
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                Some((PieceType::Queen, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let board = Board::new(custom_board, PieceColor::White, vec![]);
-
-        assert!(!board.is_checkmate());
-    }
-
-    #[test]
-    fn is_draw_true() {
-        let custom_board = [
-            [
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
-
-        assert!(board.is_draw());
-    }
-
-    #[test]
-    fn is_draw_false() {
-        let custom_board = [
-            [
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
-
-        assert!(!board.is_draw());
-    }
-
-    #[test]
-    fn is_promote_false() {
-        let custom_board = [
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-            ],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-        ];
-        let board = Board::new(
-            custom_board,
-            PieceColor::Black,
-            vec![
-                (PieceMove {
-                    piece_type: PieceType::Pawn,
-                    piece_color: PieceColor::White,
-                    from: Coord::new(7, 3),
-                    to: Coord::new(6, 3),
-                }),
-            ],
-        );
-
-        assert!(!board.is_latest_move_promotion());
-    }
-    #[test]
-    fn is_promote_true() {
-        let custom_board = [
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-            ],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-        ];
-        let board = Board::new(
-            custom_board,
-            PieceColor::Black,
-            vec![
-                (PieceMove {
-                    piece_type: PieceType::Pawn,
-                    piece_color: PieceColor::White,
-                    from: Coord::new(1, 4),
-                    to: Coord::new(0, 4),
-                }),
-            ],
-        );
-
-        assert!(board.is_latest_move_promotion());
-    }
-
-    #[test]
-    fn promote_and_checkmate() {
-        let custom_board = [
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-            ],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-        ];
-        // We setup the board
-        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
-        assert!(!board.is_latest_move_promotion());
-
-        // Move the pawn to a promote cell
-        board.move_piece_on_the_board(&Coord::new(1, 4), &Coord::new(0, 4));
-        assert!(board.is_latest_move_promotion());
-
-        // Promote the pawn
-        board.promote_piece();
-
-        // The black king gets checkmated
-        board.player_turn = PieceColor::Black;
-        assert!(board.is_checkmate());
-    }
-
-    #[test]
-    fn is_promote_true_black() {
-        let custom_board = [
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-            ],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let board = Board::new(
-            custom_board,
-            PieceColor::White,
-            vec![
-                (PieceMove {
-                    piece_type: PieceType::Pawn,
-                    piece_color: PieceColor::Black,
-                    from: Coord::new(1, 4),
-                    to: Coord::new(0, 4),
-                }),
-            ],
-        );
-
-        assert!(board.is_latest_move_promotion());
-    }
-
-    #[test]
-    fn promote_and_draw() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                Some((PieceType::King, PieceColor::White)),
-            ],
-            [
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        // We setup the board
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        assert!(!board.is_latest_move_promotion());
-
-        // Move the pawn to a promote cell
-        board.move_piece_on_the_board(&Coord::new(1, 5), &Coord::new(0, 5));
-        assert!(board.is_latest_move_promotion());
-
-        // Promote the pawn
-        board.promote_piece();
-
-        // The black king gets checkmated
-        board.player_turn = PieceColor::White;
-        assert!(board.is_draw());
-    }
-    #[test]
-    fn fifty_moves_draw() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        // We setup the board
-        let mut board = Board::new(
-            custom_board,
-            PieceColor::White,
-            vec![
-                // We don't use the history for a fifty draw
-            ],
-        );
-
-        board.consecutive_non_pawn_or_capture = 49;
-        assert!(!board.is_draw());
-
-        // Move the pawn to a make the 50th move
-        board.move_piece_on_the_board(&Coord::new(1, 6), &Coord::new(1, 5));
-        assert!(board.is_draw());
-    }
-
-    #[test]
-    fn consecutive_position_draw() {
-        let custom_board = [
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-
-        // We setup the board
-        let mut board = Board::new(
-            custom_board,
-            PieceColor::White,
-            vec![
-                (PieceMove {
-                    piece_type: PieceType::King,
-                    piece_color: PieceColor::White,
-                    from: Coord::new(0, 2),
-                    to: Coord::new(0, 1),
-                }),
-                (PieceMove {
-                    piece_type: PieceType::King,
-                    piece_color: PieceColor::Black,
-                    from: Coord::new(0, 6),
-                    to: Coord::new(0, 5),
-                }),
-                (PieceMove {
-                    piece_type: PieceType::King,
-                    piece_color: PieceColor::White,
-                    from: Coord::new(0, 1),
-                    to: Coord::new(0, 2),
-                }),
-                (PieceMove {
-                    piece_type: PieceType::King,
-                    piece_color: PieceColor::Black,
-                    from: Coord::new(0, 5),
-                    to: Coord::new(0, 6),
-                }),
-                (PieceMove {
-                    piece_type: PieceType::King,
-                    piece_color: PieceColor::White,
-                    from: Coord::new(0, 2),
-                    to: Coord::new(0, 1),
-                }),
-                (PieceMove {
-                    piece_type: PieceType::King,
-                    piece_color: PieceColor::Black,
-                    from: Coord::new(0, 6),
-                    to: Coord::new(0, 5),
-                }),
-                (PieceMove {
-                    piece_type: PieceType::King,
-                    piece_color: PieceColor::White,
-                    from: Coord::new(0, 1),
-                    to: Coord::new(0, 2),
-                }),
-                (PieceMove {
-                    piece_type: PieceType::King,
-                    piece_color: PieceColor::Black,
-                    from: Coord::new(0, 5),
-                    to: Coord::new(0, 6),
-                }),
-            ],
-        );
-
-        let mut copy_move_history = board.move_history.clone();
-
-        for piece_move in copy_move_history.iter_mut() {
-            board.move_piece_on_the_board(&piece_move.from, &piece_move.to);
-
-            // In a chess game, board.is_draw() is called after every move
-            assert!(!board.is_draw());
-        }
-
-        // Move the king to replicate a third time the same position
-        board.move_piece_on_the_board(&Coord::new(0, 2), &Coord::new(0, 1));
-        assert!(board.is_draw());
-    }
-
-    #[test]
-    fn fen_converter_1() {
-        let custom_board = [
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        // We setup the board
-        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
-
-        // Move the king to replicate a third time the same position
-        assert_eq!(board.fen_position(), "2k4R/8/4K3/8/8/8/8/8 b - - 0 0");
-    }
-
-    #[test]
-    fn fen_converter_en_passant() {
-        let custom_board = [
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        // We setup the board
-        let mut board = Board::new(
-            custom_board,
-            PieceColor::White,
-            vec![
-                (PieceMove {
-                    piece_type: PieceType::Pawn,
-                    piece_color: PieceColor::White,
-                    from: Coord::new(6, 2),
-                    to: Coord::new(4, 2),
-                }),
-            ],
-        );
-
-        // Move the king to replicate a third time the same position
-        assert_eq!(board.fen_position(), "2k4R/8/4K3/8/2P5/8/8/8 b - c3 0 0");
-    }
-    #[test]
-    fn fen_converter_castling() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Queen, PieceColor::Black)),
-                Some((PieceType::King, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Queen, PieceColor::White)),
-                Some((PieceType::King, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Rook, PieceColor::White)),
-            ],
-        ];
-        // We setup the board
-        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
-
-        // Move the king to replicate a third time the same position
-        assert_eq!(
-            board.fen_position(),
-            "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR b kq - 0 0"
-        );
-    }
-}
diff --git a/src/pieces/bishop.rs b/src/pieces/bishop.rs
index 2243c2b..d68d252 100644
--- a/src/pieces/bishop.rs
+++ b/src/pieces/bishop.rs
@@ -202,379 +202,3 @@ impl Bishop {
         }
     }
 }
-
-#[cfg(test)]
-mod tests {
-    use crate::{
-        board::{Board, Coord},
-        pieces::{bishop::Bishop, PieceColor, PieceType, Position},
-        utils::is_getting_checked,
-    };
-
-    #[test]
-    fn piece_move_no_enemies() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(0, 0),
-            Coord::new(1, 1),
-            Coord::new(2, 2),
-            Coord::new(3, 3),
-            Coord::new(5, 5),
-            Coord::new(6, 6),
-            Coord::new(7, 7),
-            Coord::new(1, 7),
-            Coord::new(2, 6),
-            Coord::new(3, 5),
-            Coord::new(5, 3),
-            Coord::new(6, 2),
-            Coord::new(7, 1),
-        ];
-        right_positions.sort();
-
-        let mut positions = Bishop::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn piece_move_one_enemies_top_right() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(0, 0),
-            Coord::new(1, 1),
-            Coord::new(2, 2),
-            Coord::new(3, 3),
-            Coord::new(5, 5),
-            Coord::new(6, 6),
-            Coord::new(7, 7),
-            Coord::new(3, 5),
-            Coord::new(5, 3),
-            Coord::new(6, 2),
-            Coord::new(7, 1),
-        ];
-        right_positions.sort();
-
-        let mut positions = Bishop::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn piece_move_multiple_enemies_and_ally_front() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                Some((PieceType::Bishop, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(3, 3),
-            Coord::new(5, 5),
-            Coord::new(3, 5),
-            Coord::new(2, 6),
-            Coord::new(1, 7),
-            Coord::new(5, 3),
-            Coord::new(6, 2),
-        ];
-        right_positions.sort();
-
-        let mut positions = Bishop::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn king_checked_can_resolve() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions = vec![Coord::new(4, 4)];
-        right_positions.sort();
-
-        let mut positions = Bishop::authorized_positions(
-            &Coord::new(5, 5),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn king_checked_cant_resolve() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions: Vec<Coord> = vec![];
-        right_positions.sort();
-
-        let mut positions = Bishop::authorized_positions(
-            &Coord::new(5, 6),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn nailing() {
-        let custom_board = [
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions = vec![Coord::new(2, 6), Coord::new(3, 7)];
-        right_positions.sort();
-
-        let mut positions = Bishop::authorized_positions(
-            &Coord::new(1, 5),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-}
diff --git a/src/pieces/king.rs b/src/pieces/king.rs
index 74a1e0d..1896a3b 100644
--- a/src/pieces/king.rs
+++ b/src/pieces/king.rs
@@ -164,779 +164,3 @@ impl King {
         valid_for_castling
     }
 }
-
-#[cfg(test)]
-mod tests {
-    use crate::{
-        board::{Board, Coord},
-        pieces::{king::King, PieceColor, PieceMove, PieceType, Position},
-        utils::is_getting_checked,
-    };
-
-    #[test]
-    fn multiple_enemies_1() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(4, 5), Coord::new(5, 4)];
-        right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn multiple_enemies_2() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                Some((PieceType::Queen, PieceColor::Black)),
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(3, 4)];
-        right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn multiple_enemies_3() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(4, 5)];
-        right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn big_castle_white() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Queen, PieceColor::Black)),
-                Some((PieceType::King, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Rook, PieceColor::White)),
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(7, 3), Coord::new(7, 0)];
-        right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(7, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn small_castle_white() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Queen, PieceColor::Black)),
-                Some((PieceType::King, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Queen, PieceColor::White)),
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(7, 5), Coord::new(7, 7)];
-        right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(7, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn big_castle_black() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::King, PieceColor::White)),
-                Some((PieceType::Queen, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Rook, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(7, 4), Coord::new(7, 7)];
-        right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(7, 3),
-            PieceColor::Black,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-    #[test]
-    fn small_castle_black() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::King, PieceColor::White)),
-                Some((PieceType::Queen, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Rook, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                Some((PieceType::Queen, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(7, 0), Coord::new(7, 2)];
-        right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(7, 3),
-            PieceColor::Black,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn big_castle_black_check_blocking() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Queen, PieceColor::Black)),
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Queen, PieceColor::White)),
-                Some((PieceType::King, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(0, 5)];
-        right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(0, 4),
-            PieceColor::Black,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn big_castle_black_king_checked() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Queen, PieceColor::Black)),
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Queen, PieceColor::White)),
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                None,
-                Some((PieceType::King, PieceColor::White)),
-            ],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions = vec![Coord::new(0, 5)];
-        right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(0, 4),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn big_castle_black_rook_already_moved() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Queen, PieceColor::Black)),
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Queen, PieceColor::White)),
-                Some((PieceType::King, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Rook, PieceColor::White)),
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(0, 5)];
-        right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(0, 4),
-            PieceColor::Black,
-            board.board,
-            &[
-                (PieceMove {
-                    piece_type: PieceType::Rook,
-                    piece_color: PieceColor::White,
-                    from: Coord::new(0, 7),
-                    to: Coord::new(4, 7),
-                }),
-                (PieceMove {
-                    piece_type: PieceType::Pawn,
-                    piece_color: PieceColor::Black,
-                    from: Coord::new(6, 2),
-                    to: Coord::new(5, 2),
-                }),
-                (PieceMove {
-                    piece_type: PieceType::Rook,
-                    piece_color: PieceColor::White,
-                    from: Coord::new(4, 7),
-                    to: Coord::new(0, 7),
-                }),
-            ],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn castle_both_sides() {
-        let custom_board = [
-            [
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                Some((PieceType::Bishop, PieceColor::Black)),
-                Some((PieceType::Knight, PieceColor::Black)),
-                Some((PieceType::Rook, PieceColor::Black)),
-            ],
-            [
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-            ],
-            [
-                Some((PieceType::Rook, PieceColor::White)),
-                Some((PieceType::Knight, PieceColor::White)),
-                Some((PieceType::Bishop, PieceColor::White)),
-                Some((PieceType::Queen, PieceColor::White)),
-                Some((PieceType::King, PieceColor::White)),
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-            ],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut white_right_positions = vec![Coord::new(7, 5), Coord::new(7, 7)];
-        white_right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(7, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(white_right_positions, positions);
-
-        board.move_piece_on_the_board(&Coord::new(7, 4), &Coord::new(7, 7));
-        board.flip_the_board();
-
-        let mut black_right_positions = vec![Coord::new(7, 4), Coord::new(7, 7)];
-        black_right_positions.sort();
-
-        let mut positions = King::authorized_positions(
-            &Coord::new(7, 3),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(black_right_positions, positions);
-    }
-}
diff --git a/src/pieces/knight.rs b/src/pieces/knight.rs
index 26d3d41..debe175 100644
--- a/src/pieces/knight.rs
+++ b/src/pieces/knight.rs
@@ -88,296 +88,3 @@ impl Knight {
         }
     }
 }
-
-#[cfg(test)]
-mod tests {
-    use crate::{
-        board::{Board, Coord},
-        pieces::{knight::Knight, PieceColor, PieceType, Position},
-        utils::is_getting_checked,
-    };
-
-    #[test]
-    fn no_enemies() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Knight, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(2, 3),
-            Coord::new(2, 5),
-            Coord::new(3, 2),
-            Coord::new(3, 6),
-            Coord::new(5, 2),
-            Coord::new(5, 6),
-            Coord::new(6, 3),
-            Coord::new(6, 5),
-        ];
-        right_positions.sort();
-
-        let mut positions = Knight::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn enemy_and_ally() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Knight, PieceColor::White)),
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(6, 5)];
-        right_positions.sort();
-
-        let mut positions = Knight::authorized_positions(
-            &Coord::new(7, 7),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn king_checked_can_resolve() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Knight, PieceColor::White)),
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Knight, PieceColor::Black)),
-            ],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions = vec![Coord::new(7, 7)];
-        right_positions.sort();
-
-        let mut positions = Knight::authorized_positions(
-            &Coord::new(6, 5),
-            PieceColor::White,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn king_checked_cant_resolve() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::White)),
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Knight, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Knight, PieceColor::Black)),
-            ],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions: Vec<Coord> = vec![];
-        right_positions.sort();
-
-        let mut positions = Knight::authorized_positions(
-            &Coord::new(6, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-    #[test]
-    fn nailing() {
-        let custom_board = [
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Knight, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions: Vec<Coord> = vec![];
-        right_positions.sort();
-
-        let mut positions = Knight::authorized_positions(
-            &Coord::new(1, 4),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-}
diff --git a/src/pieces/pawn.rs b/src/pieces/pawn.rs
index 72ae709..6b80b5d 100644
--- a/src/pieces/pawn.rs
+++ b/src/pieces/pawn.rs
@@ -160,563 +160,3 @@ impl Pawn {
         }
     }
 }
-
-#[cfg(test)]
-mod tests {
-    use crate::{
-        board::{Board, Coord},
-        pieces::{pawn::Pawn, PieceColor, PieceMove, PieceType, Position},
-        utils::is_getting_checked,
-    };
-
-    #[test]
-    fn piece_move_one_cell_forward() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(3, 4)];
-        right_positions.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn piece_move_one_cell_forward_two() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(5, 4), Coord::new(4, 4)];
-        right_positions.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(6, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn piece_move_one_cell_enemy_left_right() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(5, 3),
-            Coord::new(4, 3),
-            Coord::new(5, 4),
-            Coord::new(5, 2),
-        ];
-        right_positions.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(6, 3),
-            PieceColor::Black,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn piece_move_one_pawn_3_enemies() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(5, 4), Coord::new(5, 2)];
-        right_positions.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(6, 3),
-            PieceColor::Black,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn piece_move_3_enemies_one_pawn() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        // First pawn on the left
-        let mut right_positions_first_pawn = vec![Coord::new(1, 2), Coord::new(1, 3)];
-        right_positions_first_pawn.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(2, 2),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions_first_pawn, positions);
-
-        // Middle pawn
-        let mut right_positions_second_pawn: Vec<Coord> = vec![];
-        right_positions_second_pawn.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(2, 3),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions_second_pawn, positions);
-
-        // Third pawn on the right
-        let mut right_positions_third_pawn: Vec<Coord> = vec![Coord::new(1, 3), Coord::new(1, 4)];
-        right_positions_third_pawn.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(2, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions_third_pawn, positions);
-    }
-
-    #[test]
-    fn pawn_en_passant_white() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(2, 2), Coord::new(2, 3)];
-        right_positions.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(3, 2),
-            PieceColor::White,
-            board.board,
-            &[(PieceMove {
-                piece_type: PieceType::Pawn,
-                piece_color: PieceColor::Black,
-                from: Coord::new(6, 4),
-                to: Coord::new(4, 4),
-            })],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn pawn_en_passant_black() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(2, 2), Coord::new(2, 3)];
-        right_positions.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(3, 2),
-            PieceColor::Black,
-            board.board,
-            &[(PieceMove {
-                piece_type: PieceType::Pawn,
-                piece_color: PieceColor::White,
-                from: Coord::new(6, 4),
-                to: Coord::new(4, 4),
-            })],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn pawn_not_en_passant() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![Coord::new(5, 1), Coord::new(4, 1)];
-        right_positions.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(6, 1),
-            PieceColor::Black,
-            board.board,
-            &[(PieceMove {
-                piece_type: PieceType::Pawn,
-                piece_color: PieceColor::White,
-                from: Coord::new(6, 4),
-                to: Coord::new(4, 4),
-            })],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn king_checked_can_resolve() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions = vec![Coord::new(2, 2)];
-        right_positions.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(3, 3),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn king_checked_cant_resolve() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions: Vec<Coord> = vec![];
-        right_positions.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(2, 4),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn nailing() {
-        let custom_board = [
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions: Vec<Coord> = vec![];
-        right_positions.sort();
-
-        let mut positions = Pawn::authorized_positions(
-            &Coord::new(1, 5),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-}
diff --git a/src/pieces/queen.rs b/src/pieces/queen.rs
index 5e18230..61bdd57 100644
--- a/src/pieces/queen.rs
+++ b/src/pieces/queen.rs
@@ -79,415 +79,3 @@ impl Queen {
         }
     }
 }
-
-#[cfg(test)]
-mod tests {
-    use crate::{
-        board::{Board, Coord},
-        pieces::{queen::Queen, PieceColor, PieceType, Position},
-        utils::is_getting_checked,
-    };
-
-    #[test]
-    fn piece_move_no_enemies() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(0, 0),
-            Coord::new(0, 4),
-            Coord::new(1, 1),
-            Coord::new(1, 4),
-            Coord::new(1, 7),
-            Coord::new(2, 2),
-            Coord::new(2, 4),
-            Coord::new(2, 6),
-            Coord::new(3, 3),
-            Coord::new(3, 4),
-            Coord::new(3, 5),
-            Coord::new(4, 0),
-            Coord::new(4, 1),
-            Coord::new(4, 2),
-            Coord::new(4, 3),
-            Coord::new(4, 5),
-            Coord::new(4, 6),
-            Coord::new(4, 7),
-            Coord::new(5, 3),
-            Coord::new(5, 4),
-            Coord::new(5, 5),
-            Coord::new(6, 2),
-            Coord::new(6, 4),
-            Coord::new(6, 6),
-            Coord::new(7, 1),
-            Coord::new(7, 4),
-            Coord::new(7, 7),
-        ];
-        right_positions.sort();
-
-        let mut positions = Queen::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn piece_move_one_enemies_top_right() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(0, 0),
-            Coord::new(0, 4),
-            Coord::new(1, 1),
-            Coord::new(1, 4),
-            Coord::new(2, 2),
-            Coord::new(2, 4),
-            Coord::new(3, 3),
-            Coord::new(3, 4),
-            Coord::new(3, 5),
-            Coord::new(4, 0),
-            Coord::new(4, 1),
-            Coord::new(4, 2),
-            Coord::new(4, 3),
-            Coord::new(4, 5),
-            Coord::new(4, 6),
-            Coord::new(4, 7),
-            Coord::new(5, 3),
-            Coord::new(5, 4),
-            Coord::new(5, 5),
-            Coord::new(6, 2),
-            Coord::new(6, 4),
-            Coord::new(6, 6),
-            Coord::new(7, 1),
-            Coord::new(7, 4),
-            Coord::new(7, 7),
-        ];
-        right_positions.sort();
-
-        let mut positions = Queen::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn piece_move_enemies_and_allies() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                Some((PieceType::Pawn, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(1, 7),
-            Coord::new(2, 6),
-            Coord::new(3, 3),
-            Coord::new(3, 5),
-            Coord::new(4, 1),
-            Coord::new(4, 2),
-            Coord::new(4, 3),
-            Coord::new(4, 5),
-            Coord::new(4, 6),
-            Coord::new(4, 7),
-            Coord::new(5, 3),
-            Coord::new(5, 4),
-            Coord::new(5, 5),
-            Coord::new(6, 2),
-            Coord::new(6, 4),
-            Coord::new(7, 4),
-        ];
-
-        right_positions.sort();
-
-        let mut positions = Queen::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-    #[test]
-    fn king_checked_can_resolve() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions = vec![Coord::new(4, 4)];
-        right_positions.sort();
-
-        let mut positions = Queen::authorized_positions(
-            &Coord::new(5, 5),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-    #[test]
-    fn king_checked_cant_resolve() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Bishop, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::Black)),
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions: Vec<Coord> = vec![];
-        right_positions.sort();
-
-        let mut positions = Queen::authorized_positions(
-            &Coord::new(5, 6),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn nailing() {
-        let custom_board = [
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::Black)),
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions = vec![Coord::new(2, 6), Coord::new(3, 7)];
-        right_positions.sort();
-
-        let mut positions = Queen::authorized_positions(
-            &Coord::new(1, 5),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-}
diff --git a/src/pieces/rook.rs b/src/pieces/rook.rs
index 4cb2c2e..7b22396 100644
--- a/src/pieces/rook.rs
+++ b/src/pieces/rook.rs
@@ -201,369 +201,3 @@ impl Rook {
         }
     }
 }
-
-#[cfg(test)]
-mod tests {
-    use crate::{
-        board::{Board, Coord},
-        pieces::{rook::Rook, PieceColor, PieceType, Position},
-        utils::is_getting_checked,
-    };
-
-    #[test]
-    fn piece_move_no_enemies() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(7, 4),
-            Coord::new(6, 4),
-            Coord::new(5, 4),
-            Coord::new(3, 4),
-            Coord::new(2, 4),
-            Coord::new(1, 4),
-            Coord::new(0, 4),
-            Coord::new(4, 0),
-            Coord::new(4, 1),
-            Coord::new(4, 2),
-            Coord::new(4, 3),
-            Coord::new(4, 5),
-            Coord::new(4, 6),
-            Coord::new(4, 7),
-        ];
-        right_positions.sort();
-
-        let mut positions = Rook::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn piece_move_one_enemies_front() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(7, 4),
-            Coord::new(6, 4),
-            Coord::new(5, 4),
-            Coord::new(3, 4),
-            Coord::new(4, 0),
-            Coord::new(4, 1),
-            Coord::new(4, 2),
-            Coord::new(4, 3),
-            Coord::new(4, 5),
-            Coord::new(4, 6),
-            Coord::new(4, 7),
-        ];
-        right_positions.sort();
-
-        let mut positions = Rook::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn piece_move_multiple_enemies_and_ally_front() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                Some((PieceType::Pawn, PieceColor::Black)),
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::default();
-        board.set_board(custom_board);
-
-        let mut right_positions = vec![
-            Coord::new(4, 0),
-            Coord::new(4, 1),
-            Coord::new(4, 2),
-            Coord::new(4, 3),
-            Coord::new(4, 5),
-            Coord::new(4, 6),
-            Coord::new(3, 4),
-            Coord::new(5, 4),
-        ];
-        right_positions.sort();
-
-        let mut positions = Rook::authorized_positions(
-            &Coord::new(4, 4),
-            PieceColor::White,
-            board.board,
-            &[],
-            false,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn king_checked_can_resolve() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions = vec![Coord::new(4, 2)];
-        right_positions.sort();
-
-        let mut positions = Rook::authorized_positions(
-            &Coord::new(5, 2),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-
-    #[test]
-    fn king_checked_cant_resolve() {
-        let custom_board = [
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::White)),
-                None,
-                None,
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions: Vec<Coord> = vec![];
-        right_positions.sort();
-
-        let mut positions = Rook::authorized_positions(
-            &Coord::new(5, 3),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-    #[test]
-    fn nailing() {
-        let custom_board = [
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::King, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Rook, PieceColor::Black)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [
-                None,
-                None,
-                None,
-                None,
-                Some((PieceType::Queen, PieceColor::White)),
-                None,
-                None,
-                None,
-            ],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-            [None, None, None, None, None, None, None, None],
-        ];
-        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
-        board.set_board(custom_board);
-
-        let is_king_checked =
-            is_getting_checked(board.board, board.player_turn, &board.move_history);
-
-        let mut right_positions: Vec<Coord> = vec![Coord::new(2, 4), Coord::new(3, 4)];
-        right_positions.sort();
-
-        let mut positions = Rook::authorized_positions(
-            &Coord::new(1, 4),
-            PieceColor::Black,
-            board.board,
-            &[],
-            is_king_checked,
-        );
-        positions.sort();
-
-        assert_eq!(right_positions, positions);
-    }
-}
diff --git a/src/utils.rs b/src/utils.rs
index 9e40ada..28577d0 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -251,31 +251,3 @@ pub fn get_cell_paragraph<'a>(
 pub fn invert_position(coord: &Coord) -> Coord {
     Coord::new(7 - coord.row, 7 - coord.col)
 }
-
-#[cfg(test)]
-mod tests {
-    use crate::utils::{convert_notation_into_position, convert_position_into_notation};
-
-    #[test]
-    fn convert_position_into_notation_1() {
-        assert_eq!(convert_position_into_notation("7152"), "b1-c3")
-    }
-
-    #[test]
-    fn convert_position_into_notation_2() {
-        assert_eq!(convert_position_into_notation("0257"), "c8-h3")
-    }
-
-    #[test]
-    fn convert_notation_into_position_1() {
-        assert_eq!(convert_notation_into_position("c8b7"), "0211")
-    }
-    #[test]
-    fn convert_notation_into_position_2() {
-        assert_eq!(convert_notation_into_position("g7h8"), "1607")
-    }
-    #[test]
-    fn convert_notation_into_position_3() {
-        assert_eq!(convert_notation_into_position("g1f3"), "7655")
-    }
-}


Test patch:
diff --git a/tests/checkmates.rs b/tests/checkmates.rs
new file mode 100644
index 0000000..25466c4
--- /dev/null
+++ b/tests/checkmates.rs
@@ -0,0 +1,345 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::board::Board;
+    use chess_tui::pieces::{PieceColor, PieceType};
+    use chess_tui::utils::is_getting_checked;
+
+    #[test]
+    fn is_getting_checked_true() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        assert!(is_getting_checked(custom_board, PieceColor::White, &[]));
+    }
+
+    #[test]
+    fn is_getting_checked_false() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        assert!(!is_getting_checked(custom_board, PieceColor::White, &[]));
+    }
+
+    #[test]
+    fn is_getting_checked_piece_in_front_false() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Queen, PieceColor::Black)),
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Queen, PieceColor::White)),
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                None,
+                Some((PieceType::King, PieceColor::White)),
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        assert!(!is_getting_checked(custom_board, PieceColor::Black, &[]));
+    }
+
+    #[test]
+    fn is_getting_checked_piece_in_with_gap_false() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Queen, PieceColor::Black)),
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Queen, PieceColor::White)),
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                None,
+                Some((PieceType::King, PieceColor::White)),
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        assert!(!is_getting_checked(custom_board, PieceColor::Black, &[]));
+    }
+
+    #[test]
+    fn is_checkmate_true() {
+        let custom_board = [
+            [
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                Some((PieceType::Queen, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let board = Board::new(custom_board, PieceColor::White, vec![]);
+
+        assert!(board.is_checkmate());
+    }
+
+    #[test]
+    fn is_checkmate_false() {
+        let custom_board = [
+            [
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let board = Board::new(custom_board, PieceColor::White, vec![]);
+
+        assert!(!board.is_checkmate());
+    }
+
+    #[test]
+    fn is_checkmate_false_2() {
+        let custom_board = [
+            [
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+                None,
+            ],
+            [
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                Some((PieceType::Queen, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let board = Board::new(custom_board, PieceColor::White, vec![]);
+
+        assert!(!board.is_checkmate());
+    }
+}
diff --git a/tests/draws.rs b/tests/draws.rs
new file mode 100644
index 0000000..4005b97
--- /dev/null
+++ b/tests/draws.rs
@@ -0,0 +1,222 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::board::{Board, Coord};
+    use chess_tui::pieces::{PieceColor, PieceMove, PieceType};
+    #[test]
+    fn is_draw_true() {
+        let custom_board = [
+            [
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
+
+        assert!(board.is_draw());
+    }
+
+    #[test]
+    fn is_draw_false() {
+        let custom_board = [
+            [
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
+
+        assert!(!board.is_draw());
+    }
+
+    #[test]
+    fn fifty_moves_draw() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        // We setup the board
+        let mut board = Board::new(
+            custom_board,
+            PieceColor::White,
+            vec![
+                // We don't use the history for a fifty draw
+            ],
+        );
+
+        board.consecutive_non_pawn_or_capture = 49;
+        assert!(!board.is_draw());
+
+        // Move the pawn to a make the 50th move
+        board.move_piece_on_the_board(&Coord::new(1, 6), &Coord::new(1, 5));
+        assert!(board.is_draw());
+    }
+
+    #[test]
+    fn consecutive_position_draw() {
+        let custom_board = [
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+
+        // We setup the board
+        let mut board = Board::new(
+            custom_board,
+            PieceColor::White,
+            vec![
+                (PieceMove {
+                    piece_type: PieceType::King,
+                    piece_color: PieceColor::White,
+                    from: Coord::new(0, 2),
+                    to: Coord::new(0, 1),
+                }),
+                (PieceMove {
+                    piece_type: PieceType::King,
+                    piece_color: PieceColor::Black,
+                    from: Coord::new(0, 6),
+                    to: Coord::new(0, 5),
+                }),
+                (PieceMove {
+                    piece_type: PieceType::King,
+                    piece_color: PieceColor::White,
+                    from: Coord::new(0, 1),
+                    to: Coord::new(0, 2),
+                }),
+                (PieceMove {
+                    piece_type: PieceType::King,
+                    piece_color: PieceColor::Black,
+                    from: Coord::new(0, 5),
+                    to: Coord::new(0, 6),
+                }),
+                (PieceMove {
+                    piece_type: PieceType::King,
+                    piece_color: PieceColor::White,
+                    from: Coord::new(0, 2),
+                    to: Coord::new(0, 1),
+                }),
+                (PieceMove {
+                    piece_type: PieceType::King,
+                    piece_color: PieceColor::Black,
+                    from: Coord::new(0, 6),
+                    to: Coord::new(0, 5),
+                }),
+                (PieceMove {
+                    piece_type: PieceType::King,
+                    piece_color: PieceColor::White,
+                    from: Coord::new(0, 1),
+                    to: Coord::new(0, 2),
+                }),
+                (PieceMove {
+                    piece_type: PieceType::King,
+                    piece_color: PieceColor::Black,
+                    from: Coord::new(0, 5),
+                    to: Coord::new(0, 6),
+                }),
+            ],
+        );
+
+        let mut copy_move_history = board.move_history.clone();
+
+        for piece_move in copy_move_history.iter_mut() {
+            board.move_piece_on_the_board(&piece_move.from, &piece_move.to);
+
+            // In a chess game, board.is_draw() is called after every move
+            assert!(!board.is_draw());
+        }
+
+        // Move the king to replicate a third time the same position
+        board.move_piece_on_the_board(&Coord::new(0, 2), &Coord::new(0, 1));
+        assert!(board.is_draw());
+    }
+}
diff --git a/tests/fen.rs b/tests/fen.rs
new file mode 100644
index 0000000..d50f72f
--- /dev/null
+++ b/tests/fen.rs
@@ -0,0 +1,156 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::board::{Board, Coord};
+    use chess_tui::pieces::{PieceColor, PieceMove, PieceType};
+
+    #[test]
+    fn fen_converter_1() {
+        let custom_board = [
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        // We setup the board
+        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
+
+        // Move the king to replicate a third time the same position
+        assert_eq!(board.fen_position(), "2k4R/8/4K3/8/8/8/8/8 b - - 0 0");
+    }
+
+    #[test]
+    fn fen_converter_en_passant() {
+        let custom_board = [
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        // We setup the board
+        let mut board = Board::new(
+            custom_board,
+            PieceColor::White,
+            vec![
+                (PieceMove {
+                    piece_type: PieceType::Pawn,
+                    piece_color: PieceColor::White,
+                    from: Coord::new(6, 2),
+                    to: Coord::new(4, 2),
+                }),
+            ],
+        );
+
+        // Move the king to replicate a third time the same position
+        assert_eq!(board.fen_position(), "2k4R/8/4K3/8/2P5/8/8/8 b - c3 0 0");
+    }
+    #[test]
+    fn fen_converter_castling() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Queen, PieceColor::Black)),
+                Some((PieceType::King, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Queen, PieceColor::White)),
+                Some((PieceType::King, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Rook, PieceColor::White)),
+            ],
+        ];
+        // We setup the board
+        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
+
+        // Move the king to replicate a third time the same position
+        assert_eq!(
+            board.fen_position(),
+            "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR b kq - 0 0"
+        );
+    }
+}
diff --git a/tests/lib.rs b/tests/lib.rs
new file mode 100644
index 0000000..6c498f2
--- /dev/null
+++ b/tests/lib.rs
@@ -0,0 +1,1 @@
+pub mod pieces;
diff --git a/tests/pieces/bishop.rs b/tests/pieces/bishop.rs
new file mode 100644
index 0000000..ddb2021
--- /dev/null
+++ b/tests/pieces/bishop.rs
@@ -0,0 +1,374 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::board::{Board, Coord};
+    use chess_tui::pieces::bishop::Bishop;
+    use chess_tui::pieces::{PieceColor, PieceType, Position};
+    use chess_tui::utils::is_getting_checked;
+
+    #[test]
+    fn piece_move_no_enemies() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(0, 0),
+            Coord::new(1, 1),
+            Coord::new(2, 2),
+            Coord::new(3, 3),
+            Coord::new(5, 5),
+            Coord::new(6, 6),
+            Coord::new(7, 7),
+            Coord::new(1, 7),
+            Coord::new(2, 6),
+            Coord::new(3, 5),
+            Coord::new(5, 3),
+            Coord::new(6, 2),
+            Coord::new(7, 1),
+        ];
+        right_positions.sort();
+
+        let mut positions = Bishop::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn piece_move_one_enemies_top_right() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(0, 0),
+            Coord::new(1, 1),
+            Coord::new(2, 2),
+            Coord::new(3, 3),
+            Coord::new(5, 5),
+            Coord::new(6, 6),
+            Coord::new(7, 7),
+            Coord::new(3, 5),
+            Coord::new(5, 3),
+            Coord::new(6, 2),
+            Coord::new(7, 1),
+        ];
+        right_positions.sort();
+
+        let mut positions = Bishop::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn piece_move_multiple_enemies_and_ally_front() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                Some((PieceType::Bishop, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(3, 3),
+            Coord::new(5, 5),
+            Coord::new(3, 5),
+            Coord::new(2, 6),
+            Coord::new(1, 7),
+            Coord::new(5, 3),
+            Coord::new(6, 2),
+        ];
+        right_positions.sort();
+
+        let mut positions = Bishop::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn king_checked_can_resolve() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions = vec![Coord::new(4, 4)];
+        right_positions.sort();
+
+        let mut positions = Bishop::authorized_positions(
+            &Coord::new(5, 5),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn king_checked_cant_resolve() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions: Vec<Coord> = vec![];
+        right_positions.sort();
+
+        let mut positions = Bishop::authorized_positions(
+            &Coord::new(5, 6),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn nailing() {
+        let custom_board = [
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions = vec![Coord::new(2, 6), Coord::new(3, 7)];
+        right_positions.sort();
+
+        let mut positions = Bishop::authorized_positions(
+            &Coord::new(1, 5),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+}
diff --git a/tests/pieces/king.rs b/tests/pieces/king.rs
new file mode 100644
index 0000000..519d234
--- /dev/null
+++ b/tests/pieces/king.rs
@@ -0,0 +1,776 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::board::{Board, Coord};
+    use chess_tui::pieces::king::King;
+    use chess_tui::pieces::{PieceColor, PieceMove, PieceType, Position};
+    use chess_tui::utils::is_getting_checked;
+
+    // Test with multiple enemies around the king
+    #[test]
+    fn multiple_enemies_1() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(4, 5), Coord::new(5, 4)];
+        right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn multiple_enemies_2() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                Some((PieceType::Queen, PieceColor::Black)),
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(3, 4)];
+        right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn multiple_enemies_3() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(4, 5)];
+        right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    // Test for the castling
+    #[test]
+    fn big_castle_white() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Queen, PieceColor::Black)),
+                Some((PieceType::King, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Rook, PieceColor::White)),
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(7, 3), Coord::new(7, 0)];
+        right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(7, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn small_castle_white() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Queen, PieceColor::Black)),
+                Some((PieceType::King, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Queen, PieceColor::White)),
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(7, 5), Coord::new(7, 7)];
+        right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(7, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn big_castle_black() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::King, PieceColor::White)),
+                Some((PieceType::Queen, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Rook, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(7, 4), Coord::new(7, 7)];
+        right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(7, 3),
+            PieceColor::Black,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+    #[test]
+    fn small_castle_black() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::King, PieceColor::White)),
+                Some((PieceType::Queen, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Rook, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                Some((PieceType::Queen, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(7, 0), Coord::new(7, 2)];
+        right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(7, 3),
+            PieceColor::Black,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn big_castle_black_check_blocking() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Queen, PieceColor::Black)),
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Queen, PieceColor::White)),
+                Some((PieceType::King, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(0, 5)];
+        right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(0, 4),
+            PieceColor::Black,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn big_castle_black_king_checked() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Queen, PieceColor::Black)),
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Queen, PieceColor::White)),
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                None,
+                Some((PieceType::King, PieceColor::White)),
+            ],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions = vec![Coord::new(0, 5)];
+        right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(0, 4),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn big_castle_black_rook_already_moved() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Queen, PieceColor::Black)),
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Queen, PieceColor::White)),
+                Some((PieceType::King, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Rook, PieceColor::White)),
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(0, 5)];
+        right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(0, 4),
+            PieceColor::Black,
+            board.board,
+            &[
+                (PieceMove {
+                    piece_type: PieceType::Rook,
+                    piece_color: PieceColor::White,
+                    from: Coord::new(0, 7),
+                    to: Coord::new(4, 7),
+                }),
+                (PieceMove {
+                    piece_type: PieceType::Pawn,
+                    piece_color: PieceColor::Black,
+                    from: Coord::new(6, 2),
+                    to: Coord::new(5, 2),
+                }),
+                (PieceMove {
+                    piece_type: PieceType::Rook,
+                    piece_color: PieceColor::White,
+                    from: Coord::new(4, 7),
+                    to: Coord::new(0, 7),
+                }),
+            ],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn castle_both_sides() {
+        let custom_board = [
+            [
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                Some((PieceType::Bishop, PieceColor::Black)),
+                Some((PieceType::Knight, PieceColor::Black)),
+                Some((PieceType::Rook, PieceColor::Black)),
+            ],
+            [
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+            ],
+            [
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Knight, PieceColor::White)),
+                Some((PieceType::Bishop, PieceColor::White)),
+                Some((PieceType::Queen, PieceColor::White)),
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+            ],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut white_right_positions = vec![Coord::new(7, 5), Coord::new(7, 7)];
+        white_right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(7, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(white_right_positions, positions);
+
+        board.move_piece_on_the_board(&Coord::new(7, 4), &Coord::new(7, 7));
+        board.flip_the_board();
+
+        let mut black_right_positions = vec![Coord::new(7, 4), Coord::new(7, 7)];
+        black_right_positions.sort();
+
+        let mut positions = King::authorized_positions(
+            &Coord::new(7, 3),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(black_right_positions, positions);
+    }
+}
diff --git a/tests/pieces/knight.rs b/tests/pieces/knight.rs
new file mode 100644
index 0000000..2f21901
--- /dev/null
+++ b/tests/pieces/knight.rs
@@ -0,0 +1,291 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::board::{Board, Coord};
+    use chess_tui::pieces::knight::Knight;
+    use chess_tui::pieces::{PieceColor, PieceType, Position};
+    use chess_tui::utils::is_getting_checked;
+
+    #[test]
+    fn no_enemies() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Knight, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(2, 3),
+            Coord::new(2, 5),
+            Coord::new(3, 2),
+            Coord::new(3, 6),
+            Coord::new(5, 2),
+            Coord::new(5, 6),
+            Coord::new(6, 3),
+            Coord::new(6, 5),
+        ];
+        right_positions.sort();
+
+        let mut positions = Knight::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn enemy_and_ally() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Knight, PieceColor::White)),
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(6, 5)];
+        right_positions.sort();
+
+        let mut positions = Knight::authorized_positions(
+            &Coord::new(7, 7),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn king_checked_can_resolve() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Knight, PieceColor::White)),
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Knight, PieceColor::Black)),
+            ],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions = vec![Coord::new(7, 7)];
+        right_positions.sort();
+
+        let mut positions = Knight::authorized_positions(
+            &Coord::new(6, 5),
+            PieceColor::White,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn king_checked_cant_resolve() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Knight, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Knight, PieceColor::Black)),
+            ],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions: Vec<Coord> = vec![];
+        right_positions.sort();
+
+        let mut positions = Knight::authorized_positions(
+            &Coord::new(6, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+    #[test]
+    fn nailing() {
+        let custom_board = [
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Knight, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions: Vec<Coord> = vec![];
+        right_positions.sort();
+
+        let mut positions = Knight::authorized_positions(
+            &Coord::new(1, 4),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+}
diff --git a/tests/pieces/mod.rs b/tests/pieces/mod.rs
new file mode 100644
index 0000000..2e1a865
--- /dev/null
+++ b/tests/pieces/mod.rs
@@ -0,0 +1,6 @@
+mod bishop;
+mod king;
+mod knight;
+mod pawn;
+mod queen;
+mod rook;
diff --git a/tests/pieces/pawn.rs b/tests/pieces/pawn.rs
new file mode 100644
index 0000000..de719b6
--- /dev/null
+++ b/tests/pieces/pawn.rs
@@ -0,0 +1,558 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::board::{Board, Coord};
+    use chess_tui::pieces::pawn::Pawn;
+    use chess_tui::pieces::{PieceColor, PieceMove, PieceType, Position};
+    use chess_tui::utils::is_getting_checked;
+
+    #[test]
+    fn piece_move_one_cell_forward() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(3, 4)];
+        right_positions.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn piece_move_one_cell_forward_two() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(5, 4), Coord::new(4, 4)];
+        right_positions.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(6, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn piece_move_one_cell_enemy_left_right() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(5, 3),
+            Coord::new(4, 3),
+            Coord::new(5, 4),
+            Coord::new(5, 2),
+        ];
+        right_positions.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(6, 3),
+            PieceColor::Black,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn piece_move_one_pawn_3_enemies() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(5, 4), Coord::new(5, 2)];
+        right_positions.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(6, 3),
+            PieceColor::Black,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn piece_move_3_enemies_one_pawn() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        // First pawn on the left
+        let mut right_positions_first_pawn = vec![Coord::new(1, 2), Coord::new(1, 3)];
+        right_positions_first_pawn.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(2, 2),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions_first_pawn, positions);
+
+        // Middle pawn
+        let mut right_positions_second_pawn: Vec<Coord> = vec![];
+        right_positions_second_pawn.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(2, 3),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions_second_pawn, positions);
+
+        // Third pawn on the right
+        let mut right_positions_third_pawn: Vec<Coord> = vec![Coord::new(1, 3), Coord::new(1, 4)];
+        right_positions_third_pawn.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(2, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions_third_pawn, positions);
+    }
+
+    #[test]
+    fn pawn_en_passant_white() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(2, 2), Coord::new(2, 3)];
+        right_positions.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(3, 2),
+            PieceColor::White,
+            board.board,
+            &[(PieceMove {
+                piece_type: PieceType::Pawn,
+                piece_color: PieceColor::Black,
+                from: Coord::new(6, 4),
+                to: Coord::new(4, 4),
+            })],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn pawn_en_passant_black() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(2, 2), Coord::new(2, 3)];
+        right_positions.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(3, 2),
+            PieceColor::Black,
+            board.board,
+            &[(PieceMove {
+                piece_type: PieceType::Pawn,
+                piece_color: PieceColor::White,
+                from: Coord::new(6, 4),
+                to: Coord::new(4, 4),
+            })],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn pawn_not_en_passant() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![Coord::new(5, 1), Coord::new(4, 1)];
+        right_positions.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(6, 1),
+            PieceColor::Black,
+            board.board,
+            &[(PieceMove {
+                piece_type: PieceType::Pawn,
+                piece_color: PieceColor::White,
+                from: Coord::new(6, 4),
+                to: Coord::new(4, 4),
+            })],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn king_checked_can_resolve() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions = vec![Coord::new(2, 2)];
+        right_positions.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(3, 3),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn king_checked_cant_resolve() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions: Vec<Coord> = vec![];
+        right_positions.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(2, 4),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn nailing() {
+        let custom_board = [
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions: Vec<Coord> = vec![];
+        right_positions.sort();
+
+        let mut positions = Pawn::authorized_positions(
+            &Coord::new(1, 5),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+}
diff --git a/tests/pieces/queen.rs b/tests/pieces/queen.rs
new file mode 100644
index 0000000..5f08433
--- /dev/null
+++ b/tests/pieces/queen.rs
@@ -0,0 +1,410 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::board::{Board, Coord};
+    use chess_tui::pieces::queen::Queen;
+    use chess_tui::pieces::{PieceColor, PieceType, Position};
+    use chess_tui::utils::is_getting_checked;
+
+    #[test]
+    fn piece_move_no_enemies() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(0, 0),
+            Coord::new(0, 4),
+            Coord::new(1, 1),
+            Coord::new(1, 4),
+            Coord::new(1, 7),
+            Coord::new(2, 2),
+            Coord::new(2, 4),
+            Coord::new(2, 6),
+            Coord::new(3, 3),
+            Coord::new(3, 4),
+            Coord::new(3, 5),
+            Coord::new(4, 0),
+            Coord::new(4, 1),
+            Coord::new(4, 2),
+            Coord::new(4, 3),
+            Coord::new(4, 5),
+            Coord::new(4, 6),
+            Coord::new(4, 7),
+            Coord::new(5, 3),
+            Coord::new(5, 4),
+            Coord::new(5, 5),
+            Coord::new(6, 2),
+            Coord::new(6, 4),
+            Coord::new(6, 6),
+            Coord::new(7, 1),
+            Coord::new(7, 4),
+            Coord::new(7, 7),
+        ];
+        right_positions.sort();
+
+        let mut positions = Queen::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn piece_move_one_enemies_top_right() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(0, 0),
+            Coord::new(0, 4),
+            Coord::new(1, 1),
+            Coord::new(1, 4),
+            Coord::new(2, 2),
+            Coord::new(2, 4),
+            Coord::new(3, 3),
+            Coord::new(3, 4),
+            Coord::new(3, 5),
+            Coord::new(4, 0),
+            Coord::new(4, 1),
+            Coord::new(4, 2),
+            Coord::new(4, 3),
+            Coord::new(4, 5),
+            Coord::new(4, 6),
+            Coord::new(4, 7),
+            Coord::new(5, 3),
+            Coord::new(5, 4),
+            Coord::new(5, 5),
+            Coord::new(6, 2),
+            Coord::new(6, 4),
+            Coord::new(6, 6),
+            Coord::new(7, 1),
+            Coord::new(7, 4),
+            Coord::new(7, 7),
+        ];
+        right_positions.sort();
+
+        let mut positions = Queen::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn piece_move_enemies_and_allies() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(1, 7),
+            Coord::new(2, 6),
+            Coord::new(3, 3),
+            Coord::new(3, 5),
+            Coord::new(4, 1),
+            Coord::new(4, 2),
+            Coord::new(4, 3),
+            Coord::new(4, 5),
+            Coord::new(4, 6),
+            Coord::new(4, 7),
+            Coord::new(5, 3),
+            Coord::new(5, 4),
+            Coord::new(5, 5),
+            Coord::new(6, 2),
+            Coord::new(6, 4),
+            Coord::new(7, 4),
+        ];
+
+        right_positions.sort();
+
+        let mut positions = Queen::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+    #[test]
+    fn king_checked_can_resolve() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions = vec![Coord::new(4, 4)];
+        right_positions.sort();
+
+        let mut positions = Queen::authorized_positions(
+            &Coord::new(5, 5),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+    #[test]
+    fn king_checked_cant_resolve() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Bishop, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::Black)),
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions: Vec<Coord> = vec![];
+        right_positions.sort();
+
+        let mut positions = Queen::authorized_positions(
+            &Coord::new(5, 6),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn nailing() {
+        let custom_board = [
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::Black)),
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions = vec![Coord::new(2, 6), Coord::new(3, 7)];
+        right_positions.sort();
+
+        let mut positions = Queen::authorized_positions(
+            &Coord::new(1, 5),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+}
diff --git a/tests/pieces/rook.rs b/tests/pieces/rook.rs
new file mode 100644
index 0000000..075dd27
--- /dev/null
+++ b/tests/pieces/rook.rs
@@ -0,0 +1,364 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::board::{Board, Coord};
+    use chess_tui::pieces::rook::Rook;
+    use chess_tui::pieces::{PieceColor, PieceType, Position};
+    use chess_tui::utils::is_getting_checked;
+
+    #[test]
+    fn piece_move_no_enemies() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(7, 4),
+            Coord::new(6, 4),
+            Coord::new(5, 4),
+            Coord::new(3, 4),
+            Coord::new(2, 4),
+            Coord::new(1, 4),
+            Coord::new(0, 4),
+            Coord::new(4, 0),
+            Coord::new(4, 1),
+            Coord::new(4, 2),
+            Coord::new(4, 3),
+            Coord::new(4, 5),
+            Coord::new(4, 6),
+            Coord::new(4, 7),
+        ];
+        right_positions.sort();
+
+        let mut positions = Rook::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn piece_move_one_enemies_front() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(7, 4),
+            Coord::new(6, 4),
+            Coord::new(5, 4),
+            Coord::new(3, 4),
+            Coord::new(4, 0),
+            Coord::new(4, 1),
+            Coord::new(4, 2),
+            Coord::new(4, 3),
+            Coord::new(4, 5),
+            Coord::new(4, 6),
+            Coord::new(4, 7),
+        ];
+        right_positions.sort();
+
+        let mut positions = Rook::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn piece_move_multiple_enemies_and_ally_front() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::default();
+        board.set_board(custom_board);
+
+        let mut right_positions = vec![
+            Coord::new(4, 0),
+            Coord::new(4, 1),
+            Coord::new(4, 2),
+            Coord::new(4, 3),
+            Coord::new(4, 5),
+            Coord::new(4, 6),
+            Coord::new(3, 4),
+            Coord::new(5, 4),
+        ];
+        right_positions.sort();
+
+        let mut positions = Rook::authorized_positions(
+            &Coord::new(4, 4),
+            PieceColor::White,
+            board.board,
+            &[],
+            false,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn king_checked_can_resolve() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions = vec![Coord::new(4, 2)];
+        right_positions.sort();
+
+        let mut positions = Rook::authorized_positions(
+            &Coord::new(5, 2),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+
+    #[test]
+    fn king_checked_cant_resolve() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions: Vec<Coord> = vec![];
+        right_positions.sort();
+
+        let mut positions = Rook::authorized_positions(
+            &Coord::new(5, 3),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+    #[test]
+    fn nailing() {
+        let custom_board = [
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Queen, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        board.set_board(custom_board);
+
+        let is_king_checked =
+            is_getting_checked(board.board, board.player_turn, &board.move_history);
+
+        let mut right_positions: Vec<Coord> = vec![Coord::new(2, 4), Coord::new(3, 4)];
+        right_positions.sort();
+
+        let mut positions = Rook::authorized_positions(
+            &Coord::new(1, 4),
+            PieceColor::Black,
+            board.board,
+            &[],
+            is_king_checked,
+        );
+        positions.sort();
+
+        assert_eq!(right_positions, positions);
+    }
+}
diff --git a/tests/promotions.rs b/tests/promotions.rs
new file mode 100644
index 0000000..3619b4d
--- /dev/null
+++ b/tests/promotions.rs
@@ -0,0 +1,287 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::board::{Board, Coord};
+    use chess_tui::pieces::{PieceColor, PieceMove, PieceType};
+    #[test]
+    fn is_promote_true() {
+        let custom_board = [
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+            ],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+        ];
+        let board = Board::new(
+            custom_board,
+            PieceColor::Black,
+            vec![
+                (PieceMove {
+                    piece_type: PieceType::Pawn,
+                    piece_color: PieceColor::White,
+                    from: Coord::new(1, 4),
+                    to: Coord::new(0, 4),
+                }),
+            ],
+        );
+
+        assert!(board.is_latest_move_promotion());
+    }
+    #[test]
+    fn is_promote_false() {
+        let custom_board = [
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+            ],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+        ];
+        let board = Board::new(
+            custom_board,
+            PieceColor::Black,
+            vec![
+                (PieceMove {
+                    piece_type: PieceType::Pawn,
+                    piece_color: PieceColor::White,
+                    from: Coord::new(7, 3),
+                    to: Coord::new(6, 3),
+                }),
+            ],
+        );
+
+        assert!(!board.is_latest_move_promotion());
+    }
+
+    #[test]
+    fn promote_and_checkmate() {
+        let custom_board = [
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+            ],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::White)),
+                Some((PieceType::Pawn, PieceColor::White)),
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                Some((PieceType::King, PieceColor::White)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+        ];
+        // We setup the board
+        let mut board = Board::new(custom_board, PieceColor::White, vec![]);
+        assert!(!board.is_latest_move_promotion());
+
+        // Move the pawn to a promote cell
+        board.move_piece_on_the_board(&Coord::new(1, 4), &Coord::new(0, 4));
+        assert!(board.is_latest_move_promotion());
+
+        // Promote the pawn
+        board.promote_piece();
+
+        // The black king gets checkmated
+        board.player_turn = PieceColor::Black;
+        assert!(board.is_checkmate());
+    }
+
+    #[test]
+    fn is_promote_true_black() {
+        let custom_board = [
+            [
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                None,
+                Some((PieceType::King, PieceColor::White)),
+            ],
+            [
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+            ],
+            [
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        let board = Board::new(
+            custom_board,
+            PieceColor::White,
+            vec![
+                (PieceMove {
+                    piece_type: PieceType::Pawn,
+                    piece_color: PieceColor::Black,
+                    from: Coord::new(1, 4),
+                    to: Coord::new(0, 4),
+                }),
+            ],
+        );
+
+        assert!(board.is_latest_move_promotion());
+    }
+
+    #[test]
+    fn promote_and_draw() {
+        let custom_board = [
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Pawn, PieceColor::Black)),
+                None,
+                Some((PieceType::King, PieceColor::White)),
+            ],
+            [
+                None,
+                Some((PieceType::King, PieceColor::Black)),
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [
+                None,
+                None,
+                None,
+                None,
+                None,
+                None,
+                Some((PieceType::Rook, PieceColor::Black)),
+                None,
+            ],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+            [None, None, None, None, None, None, None, None],
+        ];
+        // We setup the board
+        let mut board = Board::new(custom_board, PieceColor::Black, vec![]);
+        assert!(!board.is_latest_move_promotion());
+
+        // Move the pawn to a promote cell
+        board.move_piece_on_the_board(&Coord::new(1, 5), &Coord::new(0, 5));
+        assert!(board.is_latest_move_promotion());
+
+        // Promote the pawn
+        board.promote_piece();
+
+        // The black king gets checkmated
+        board.player_turn = PieceColor::White;
+        assert!(board.is_draw());
+    }
+}
diff --git a/tests/utils.rs b/tests/utils.rs
new file mode 100644
index 0000000..924c5a2
--- /dev/null
+++ b/tests/utils.rs
@@ -0,0 +1,27 @@
+#[cfg(test)]
+mod tests {
+    use chess_tui::utils::{convert_notation_into_position, convert_position_into_notation};
+
+    #[test]
+    fn convert_position_into_notation_1() {
+        assert_eq!(convert_position_into_notation("7152"), "b1-c3")
+    }
+
+    #[test]
+    fn convert_position_into_notation_2() {
+        assert_eq!(convert_position_into_notation("0257"), "c8-h3")
+    }
+
+    #[test]
+    fn convert_notation_into_position_1() {
+        assert_eq!(convert_notation_into_position("c8b7"), "0211")
+    }
+    #[test]
+    fn convert_notation_into_position_2() {
+        assert_eq!(convert_notation_into_position("g7h8"), "1607")
+    }
+    #[test]
+    fn convert_notation_into_position_3() {
+        assert_eq!(convert_notation_into_position("g1f3"), "7655")
+    }
+}