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));
        }
        public void CheckIfPlayersListIsCorrect()
        {
            Player ivan = new Player("Ivan", 43);
            Player stoyan = new Player("Stoyan", 35);
            Player yasen = new Player("Yasen", 57);

            ScoreboardProxy scoreboard = new ScoreboardProxy();
            scoreboard.AddPlayer(ivan);
            scoreboard.AddPlayer(stoyan);
            scoreboard.AddPlayer(yasen);

            Assert.IsTrue(scoreboard.Players[0].Name == "Stoyan" && scoreboard.Players[0].Moves == 35 &&
                scoreboard.Players[1].Name == "Ivan" && scoreboard.Players[1].Moves == 43 &&
                scoreboard.Players[2].Name == "Yasen" && scoreboard.Players[2].Moves == 57);
        }
        public void CheckIfPlayersListHasCorrectLength()
        {
            Player ivan = new Player("Ivan", 43);
            Player stoyan = new Player("Stoyan", 35);
            Player yasen = new Player("Yasen", 57);
            Player peter = new Player("Peter", 17);
            Player gosho = new Player("Gosho", 38);
            Player zhechko = new Player("Zhechko", 14);

            ScoreboardProxy scoreboard = new ScoreboardProxy();
            scoreboard.AddPlayer(ivan);
            scoreboard.AddPlayer(stoyan);
            scoreboard.AddPlayer(yasen);
            scoreboard.AddPlayer(peter);
            scoreboard.AddPlayer(gosho);
            scoreboard.AddPlayer(zhechko);

            Assert.AreEqual(scoreboard.Players.Count, 5);
        }
        public void CheckIfPlayerListInScoreboardIsWithCorrectType()
        {
            ScoreboardProxy scoreboard = new ScoreboardProxy();

            Assert.IsInstanceOfType(scoreboard.Players, typeof(IList<IPlayer>));
        }