public void CheckIfExitCommandConstructorWorksProperly()
        {
            IMatrixField field = FieldFactory.Instance.GetField(5);
            IScoreboard scoreboard = new ScoreboardProxy();
            IRandomNumberGenerator random = new RandomNumberGenerator();
            IGameEngine gameEngine = new GameFifteenEngine(field, scoreboard, random);

            ExitCommand exitCommand = new ExitCommand(gameEngine);

            Assert.IsInstanceOfType(exitCommand, typeof(Command));
        }
        public void CheckIfmoveCellCommandCommandConstructorWorksProperly()
        {
            IMatrixField field = FieldFactory.Instance.GetField(5);
            IScoreboard scoreboard = new ScoreboardProxy();
            IRandomNumberGenerator random = new RandomNumberGenerator();
            IGameEngine gameEngine = new GameFifteenEngine(field, scoreboard, random);
            string destination = "restart";

            MoveCellCommand moveCellCommand = new MoveCellCommand(gameEngine, destination);

            Assert.IsInstanceOfType(moveCellCommand, typeof(Command));
        }
        public void CheckIfMethodExitExecuteReturnsProperString()
        {
            IMatrixField field = FieldFactory.Instance.GetField(5);
            IScoreboard scoreboard = new ScoreboardProxy();
            IRandomNumberGenerator random = new RandomNumberGenerator();
            IGameEngine gameEngine = new GameFifteenEngine(field, scoreboard, random);

            ExitCommand exitCommand = new ExitCommand(gameEngine);

            string result = exitCommand.Execute();

            Assert.AreEqual(result, GlobalConstants.ExitMessage);
        }
        public void CheckIfMethodTopExecuteReturnsProperEmptyString()
        {
            IMatrixField field = FieldFactory.Instance.GetField(5);
            IScoreboard scoreboard = new ScoreboardProxy();
            IRandomNumberGenerator random = new RandomNumberGenerator();
            IGameEngine gameEngine = new GameFifteenEngine(field, scoreboard, random);

            TopCommand topCommand = new TopCommand(gameEngine);

            string result = topCommand.Execute();

            Assert.IsInstanceOfType(result, typeof(String));
        }
        /// <summary>
        /// Method to starts the game
        /// </summary>
        public static void Main()
        {
            IMatrixField field = FieldFactory.Instance.GetField(4);
            IScoreboard scoreboard = new ScoreboardProxy();
            IRandomNumberGenerator random = new RandomNumberGenerator();
            IGameEngine gameEngine = new GameFifteenEngine(field, scoreboard, random);

            IRenderer renderer = new ConsoleRenderer();
            IInputHandler inputHandler = new InputHandler();
            IGameController gameFifteenControl = new GameController(gameEngine, inputHandler, renderer);

            gameFifteenControl.Start();
        }
        public void CheckIfMethodMoveCellCommandExecuteReturnsProperStringTwo()
        {
            IMatrixField field = FieldFactory.Instance.GetField(5);
            IScoreboard scoreboard = new ScoreboardProxy();
            IRandomNumberGenerator random = new RandomNumberGenerator();
            IGameEngine gameEngine = new GameFifteenEngine(field, scoreboard, random);
            string destination = "9";

            MoveCellCommand moveCellCommand = new MoveCellCommand(gameEngine, destination);

            string result = moveCellCommand.Execute();

            Assert.IsInstanceOfType(result, typeof(String));
        }