def test_cant_capture_diagonally(self): rook = Rook(color='WHITE') is_valid_capture = rook.validate_capture((4,2), (5,3)) self.assertFalse(is_valid_capture) is_valid_capture = rook.validate_capture((4,2), (3,1)) self.assertFalse(is_valid_capture) is_valid_capture = rook.validate_capture((4,2), (3,3)) self.assertFalse(is_valid_capture) is_valid_capture = rook.validate_capture((4,2), (5,1)) self.assertFalse(is_valid_capture) is_valid_capture = rook.validate_capture((4,2), (3,3)) self.assertFalse(is_valid_capture) is_valid_capture = rook.validate_capture((4,2), (3,1)) self.assertFalse(is_valid_capture) is_valid_capture = rook.validate_capture((4,2), (5,3)) self.assertFalse(is_valid_capture) is_valid_capture = rook.validate_capture((4,2), (3,1)) self.assertFalse(is_valid_capture)
def test_can_capture_backward(self): rook = Rook(color='WHITE') is_valid_capture = rook.validate_capture((4,2), (7,2)) self.assertTrue(is_valid_capture)
def test_can_capture_sideways(self): rook = Rook(color='BLACK') is_valid_capture = rook.validate_capture((7,2), (7,4)) self.assertTrue(is_valid_capture)