CIT 590: Jigsaw Puzzle code structure
Spring 2013, David Matuszek

We will be testing your code with our unit tests. In order for your code to pass the tests, it has to have the correct structure. Since in this assignment you are working from another program, not from a specification, the intended structure may not be perfectly clear.

To avoid a lot of needless test failures, here is the structure that is expected of your program. Use exactly these names for files, classes, and methods (parameter names do not need to be exactly as given).

from PuzzlePiece import *
from JigsawPuzzle import *
from PuzzleCreator import *
from PuzzleSolver import *
from SolutionChecker import *

import unittest

class TestStuff(unittest.TestCase):

    def test_whether_all_the_methods_are_callable(self):
        piece = PuzzlePiece(1, 2, 3, 4)
        piece.getTop()
        piece.getLeft()
        piece.getRight()
        piece.getBottom()
        PuzzlePiece.lastThreeDigits(123456789)
        s = str(piece)
        
        jigsawPuzzle = JigsawPuzzle()
##        JigsawPuzzle.main(5, 5)
        
        creator = PuzzleCreator()
        pieces = creator.create(5, 8)
        PuzzleCreator.shuffle(pieces)

        solver = PuzzleSolver()
        solver.findPiece(0, 0, pieces)
        solvedPuzzle = solver.solve(5, 8, pieces)

        checker = SolutionChecker()
        checker.isCorrectlyAssembled(solvedPuzzle)

unittest.main()