示例#1
0
        public void c_MinotaurReaction_Diagonal_1block_downright()
        {
            Point expectedPoint, actualPoint, minStart, thesStart;
            minStart = new Point(1, 1);
            thesStart = new Point(2, 2);
            expectedPoint = new Point(2, 2);
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();
            Minotaur minotaur = aGame.GetMinotaur();

            aGame.SetTestMap(2);
            aGame.GetTheseus().Coordinate = thesStart;
            aGame.GetMinotaur().Coordinate = minStart;

            /*
            .___.___.___.___.
            | 0   1   2   3 |
            .   .   .   .   .
            | 1   M         |
            .   .   .   .   .___.
            | 2       T       X
            .   .   .   .   .___.
            | 3             |
            .___.___.___.___. */

            aGame.GetMinotaur().Hunt();
            actualPoint = aGame.GetMinotaurPosition();

            Assert.AreEqual(expectedPoint, actualPoint, "Minotaur was not on the expected Tile");
        }
示例#2
0
        public void b_BlockedMovementTest_Right()
        {
            Point expectedPoint, actualPoint, theseusPoint;
            expectedPoint = new Point(2, 1);
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();
            theseusPoint = new Point(2, 1);

            aGame.SetTestMap(1);
            aGame.GetTheseus().Coordinate = theseusPoint;

            /*
            .___.___.___.
            | 0   1   2 |
            .   .   .   .
            | 1       T |
            .   .   .   .
            | 2         |
            .___.___.___.  */

            aGame.GetTheseus().Move(Direction.Right);
            actualPoint = aGame.GetTheseusPosition();

            Assert.AreEqual(expectedPoint, actualPoint, "Theseus was not stopped by the block. Superman?");
        }
示例#3
0
        public void e_ExitTile_NotFinished()
        {
            Point thesStart;
            bool expected, actual;
            thesStart = new Point(2, 2);
            expected = false;
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();
            Minotaur minotaur = aGame.GetMinotaur();

            aGame.SetTestMap(2);
            aGame.GetTheseus().Coordinate = thesStart;

            /*
            .___.___.___.___.
            | 0   1   2   3 |
            .   .   .   .   .
            | 1             |
            .   .   .   .   .___.
            | 2       T       X
            .   .   .   .   .___.
            | 3             |
            .___.___.___.___. */

            aGame.GetTheseus().Move(Direction.Right);
            actual = aGame.GetTheseus().IsFinished();

            Assert.AreEqual(actual, expected, "Theseus finished the maze");
        }
        public void d_MinotaurReaction_Diagonal_blockeddownright_1block_downright()
        {
            Point expectedPoint, actualPoint, minStart, thesStart;
            minStart = new Point(1, 1);
            thesStart = new Point(2, 2);
            expectedPoint = new Point(1, 1);
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();
            Minotaur minotaur = aGame.GetMinotaur();

            aGame.SetTestMap(2);
            Tile[,] theMap = aGame.GetMap();
            theMap[1, 1].MyWalls = TheWalls.South | TheWalls.East;
            theMap[1, 2].MyWalls = TheWalls.North;
            theMap[2, 1].MyWalls = TheWalls.West;
            aGame.GetTheseus().Coordinate = thesStart;
            aGame.GetMinotaur().Coordinate = minStart;

            /*
            .___.___.___.___.
            | 0   1   2   3 |
            .   .   .   .   .
            | 1   M |       |
            .   .___.   .   .___.
            | 2       T       X
            .   .   .   .   .___.
            | 3             |
            .___.___.___.___. */

            aGame.GetMinotaur().Hunt();
            actualPoint = aGame.GetMinotaurPosition();

            Assert.AreEqual(expectedPoint, actualPoint, "Minotaur was not on the expected Tile");
        }
        public void d_MinotaurReaction_Diagonal_blockeddownleft_3blocks_downleft_3()
        {
            Point expectedPoint, actualPoint, minStart, thesStart;
            minStart = new Point(3, 0);
            thesStart = new Point(2, 3);
            expectedPoint = new Point(3, 0);
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();
            Minotaur minotaur = aGame.GetMinotaur();

            aGame.SetTestMap(2);
            Tile[,] theMap = aGame.GetMap();
            theMap[3, 0].MyWalls = TheWalls.North | TheWalls.South | TheWalls.East | TheWalls.West;
            theMap[3, 1].MyWalls = TheWalls.North | TheWalls.East;
            theMap[2, 0].MyWalls = TheWalls.North | TheWalls.East;
            aGame.GetTheseus().Coordinate = thesStart;
            aGame.GetMinotaur().Coordinate = minStart;

            /*
            .___.___.___.___.
            | 0   1   2 | M |
            .   .   .   .___.
            | 1             |
            .   .   .   .   .___.
            | 2               X
            .   .   .   .   .___.
            | 3       T     |
            .___.___.___.___. */

            aGame.GetMinotaur().Hunt();
            actualPoint = aGame.GetMinotaurPosition();

            Assert.AreEqual(expectedPoint, actualPoint, "Minotaur was not on the expected Tile");
        }
示例#6
0
        public void a_BasicMovementTest_Right()
        {
            Point expectedPoint, actualPoint;
            expectedPoint = new Point(2, 1);
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();

            aGame.SetTestMap(1);
            /*
            .___.___.___.
            | 0   1   2 |
            .   .   .   .___.
            | 1   T   E | M |
            .   .   .   .___.
            | 2         |
            .___.___.___.  */

            aGame.GetTheseus().Move(Direction.Right);
            actualPoint = aGame.GetTheseusPosition();

            Assert.AreEqual(expectedPoint, actualPoint, "Theseus was not on the expected Tile");
        }
示例#7
0
        public void b_IsBlockedTest_Up()
        {
            Point theseusPoint;
            Boolean expected, actual;
            expected = true;
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();
            theseusPoint = new Point(1, 0);

            aGame.SetTestMap(1);
            aGame.GetTheseus().Coordinate = theseusPoint;

            /*
            .___.___.___.
            | 0   T   2 |
            .   .   .   .
            | 1         |
            .   .   .   .
            | 2         |
            .___.___.___.  */

            actual = aGame.GetTheseus().IsBlocked(Direction.Up);

            Assert.AreEqual(expected, actual, "Theseus did not recognise he was blocked");
        }
示例#8
0
        public void c_MinotaurReaction_Vertical_3blocks()
        {
            Point expectedPoint, actualPoint, minStart, thesStart;
            minStart = new Point(0, 0);
            thesStart = new Point(0, 3);
            expectedPoint = new Point(0, 2);
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();
            Minotaur minotaur = aGame.GetMinotaur();

            aGame.SetTestMap(2);
            aGame.GetTheseus().Coordinate = thesStart;
            aGame.GetMinotaur().Coordinate = minStart;

            /*
            .___.___.___.___.
            | M   1   2   3 |
            .   .   .   .   .
            | 1             |
            .   .   .   .   .___.
            | E               X
            .   .   .   .   .___.
            | T             |
            .___.___.___.___. */

            aGame.GetMinotaur().Hunt();
            actualPoint = aGame.GetMinotaurPosition();

            Assert.AreEqual(expectedPoint, actualPoint, "Minotaur was not on the expected Tile");
        }
        public void d_MinotaurReaction_Diagonal_blockedLeft_1block_upleft()
        {
            Point expectedPoint, actualPoint, minStart, thesStart;
            minStart = new Point(1, 1);
            thesStart = new Point(0, 0);
            expectedPoint = new Point(0, 0);
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();
            Minotaur minotaur = aGame.GetMinotaur();

            aGame.SetTestMap(2);
            aGame.GetMap()[1, 1].MyWalls = TheWalls.West;
            aGame.GetMap()[0, 1].MyWalls = TheWalls.West | TheWalls.East;
            aGame.GetTheseus().Coordinate = thesStart;
            aGame.GetMinotaur().Coordinate = minStart;

            /*
            .___.___.___.___.
            | T   1   2   3 |
            .   .   .   .   .
            | 1 | M         |
            .   .   .   .   .___.
            | 2               X
            .   .   .   .   .___.
            | 3             |
            .___.___.___.___. */

            aGame.GetMinotaur().Hunt();
            actualPoint = aGame.GetMinotaurPosition();

            Assert.AreEqual(expectedPoint, actualPoint, "Minotaur was not on the expected Tile");
        }
        public void d_MinotaurReaction_Vertical_1block()
        {
            Point expectedPoint, actualPoint, minStart, thesStart;
            minStart = new Point(0, 0);
            thesStart = new Point(0, 1);
            expectedPoint = new Point(0, 0);
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();
            Minotaur minotaur = aGame.GetMinotaur();

            aGame.SetTestMap(2);
            aGame.GetMap()[0, 0].MyWalls = TheWalls.North | TheWalls.South | TheWalls.West;
            aGame.GetMap()[0, 1].MyWalls = TheWalls.North | TheWalls.West;
            aGame.GetTheseus().Coordinate = thesStart;
            aGame.GetMinotaur().Coordinate = minStart;

            /*
            .___.___.___.___.
            | M   1   2   3 |
            .___.   .   .   .
            | T             |
            .   .   .   .   .___.
            | 2               X
            .   .   .   .   .___.
            | 3             |
            .___.___.___.___. */

            aGame.GetMinotaur().Hunt();
            actualPoint = aGame.GetMinotaurPosition();

            Assert.AreEqual(expectedPoint, actualPoint, "Minotaur was not on the expected Tile");
        }
        public void d_MinotaurReaction_Diagonal_blockedup_3blocks_upright_2()
        {
            Point expectedPoint, actualPoint, minStart, thesStart;
            minStart = new Point(0, 3);
            thesStart = new Point(1, 0);
            expectedPoint = new Point(1, 2);
            Game aGame = new Game();
            Theseus theseus = aGame.GetTheseus();
            Minotaur minotaur = aGame.GetMinotaur();

            aGame.SetTestMap(2);
            Tile[,] theMap = aGame.GetMap();
            theMap[0, 3].MyWalls = TheWalls.South | TheWalls.West | TheWalls.North;
            theMap[0, 2].MyWalls = TheWalls.West | TheWalls.South;
            aGame.GetTheseus().Coordinate = thesStart;
            aGame.GetMinotaur().Coordinate = minStart;

            /*
            .___.___.___.___.
            | 0   T   2   3 |
            .   .   .   .   .
            | 1             |
            .   .   .   .   .___.
            | 2               X
            .___.   .   .   .___.
            | M             |
            .___.___.___.___. */

            aGame.GetMinotaur().Hunt();
            actualPoint = aGame.GetMinotaurPosition();

            Assert.AreEqual(expectedPoint, actualPoint, "Minotaur was not on the expected Tile");
        }