예제 #1
0
        public void TestInvalidCurrentCellWithRowOrColGreaterThanOrEqualTheSize()
        {
            var size      = 15;
            var labyrinth = new LabyrinthPlayField(new Factory(), new MoveHandler(), size);

            labyrinth.CurrentCell = new Cell(size, 10, CellState.Empty);
        }
예제 #2
0
        public void TestInvalidCurrentCellWithNegativeCellRowOrColParams()
        {
            var size      = 15;
            var labyrinth = new LabyrinthPlayField(new Factory(), new MoveHandler(), size);

            labyrinth.CurrentCell = new Cell(5, -1, CellState.Empty);
        }
예제 #3
0
        public void TheStartingPointMustBeInTheMiddleOfTheField()
        {
            var size      = 15;
            var labyrinth = new LabyrinthPlayField(new Factory(), new MoveHandler(), size);

            Assert.IsTrue(labyrinth.CurrentCell.Row == (size / 2) && labyrinth.CurrentCell.Col == (size / 2));
        }
예제 #4
0
        public void ProducedMatrixMustHaveCorrectSize()
        {
            var size      = 10;
            var labyrinth = new LabyrinthPlayField(new Factory(), new MoveHandler(), size);

            Assert.AreEqual(size, labyrinth.Matrix.GetLength(0));
        }
예제 #5
0
        public void RowsSizeMustBeEqualToColsSize()
        {
            var size      = 5;
            var labyrinth = new LabyrinthPlayField(new Factory(), new MoveHandler(), size);

            Assert.IsTrue(labyrinth.Matrix.GetLength(0) == labyrinth.Matrix.GetLength(1));
        }
        public void TestLabyrinthConsoleGraphicInstance()
        {
            IFactory            testFactory   = new Factory();
            IMoveHandler        testHandler   = new MoveHandler();
            ILabyrinthPlayField testLabyrinth = new LabyrinthPlayField(testFactory, testHandler);
            IntPoint            testCoords    = new IntPoint(5, 5);
            IRenderer           testRenderer  = new ConsoleRenderer();

            IRenderable testLabConsGraphic    = new LabyrinthConsoleGraphic(testLabyrinth, testCoords, testRenderer);
            IRenderable factoryLabConsGraphic = testConsoleGraphicFactory.GetLabyrinthConsoleGraphic(testLabyrinth, testCoords, testRenderer);

            Object.Equals(testLabConsGraphic, factoryLabConsGraphic);
        }