public void ExitConfigrationTest()
        {
            IExitConfiguration exitConfiguration = new ExitConfiguration("4 2");

            Assert.AreEqual(exitConfiguration.GetExitPoint().X, 4);
            Assert.AreEqual(exitConfiguration.GetExitPoint().Y, 2);
        }
Beispiel #2
0
        public void StartIsNotOnBoard()
        {
            IBoardConfiguration boardConfiguration = new BoardConfiguration("5 4");
            IExitConfiguration  exitConfiguration  = new ExitConfiguration("4 2");
            IMinesConfiguration minesConfiguration = new MinesConfiguration("1,1 1,3 3,3");
            IMoveConfiguration  moveConfiguration  = new MoveConfiguration(new List <string>()
            {
                "M R L", "L M R", "R M L"
            });
            IStartConfiguration startConfiguration = new StartConfiguration("6 9 N");

            IBoard                  board  = boardConfiguration.GetBoard();
            List <ICoordinate>      mines  = minesConfiguration.GetMines();
            ICoordinate             exit   = exitConfiguration.GetExitPoint();
            IPosition               start  = startConfiguration.GetStartPoint();
            List <List <MoveType> > moves  = moveConfiguration.GetMoves();
            ITurtle                 turtle = new Turtle(start);

            IGameValidator gameValidator = new GameValidator(board, mines, exit, start, moves, turtle);

            gameValidator.Validate();
        }