public void TestCheckIfCommandIsCoordinateNegative()
 {
     PlayField field = new PlayField(3, 4);
     CommandParser parser = new CommandParser();
     bool isCoordinate = parser.CheckIfCommandIsCoordinate("-4, ,     -5", field);
     Assert.AreEqual(false, isCoordinate);
 }
 public void TestCheckIfCommandIsCoordinateTwoOne()
 {
     PlayField field = new PlayField(3, 4);
     CommandParser parser = new CommandParser();
     bool isCoordinate = parser.CheckIfCommandIsCoordinate("2, ,     1", field);
     Assert.AreEqual(true, isCoordinate);
 }
 public void TestCheckIfCommandIsCoordinateIsCoordinateSevenFiveComma()
 {
     PlayField field = new PlayField(3, 4);
     CommandParser parser = new CommandParser();
     bool isCoordinate = parser.CheckIfCommandIsCoordinate("7, 5", field);
     Assert.AreEqual(false, isCoordinate);
 }
        public void TestCheckIfPoppableBallonsNotPoppable()
        {
            PlayField field = new PlayField(3, 3, 1);
            field.MakeChangesToField(1, 1);
            CommandParser parser = new CommandParser();
            int countPopped=0;
            for (int i = 0; i < field.GetLength(0); i++)
            {
                for (int j = 0; j < field.GetLength(1); j++)
                {
                    if (!parser.CheckPoppableBalloon( i.ToString()+" "+j.ToString(), field))
                    {
                        countPopped++;
                    }
                }
            }

            Assert.AreEqual(9, countPopped);
        }
 public void TestCheckParseCommandToColFive()
 {
     CommandParser parser = new CommandParser();
     int col= parser.ParseCommandToCol("3, 5");
     Assert.AreEqual(5, col);
 }
 public void TestCheckIfPoppableBallonsPoppable()
 {
     PlayField field = new PlayField(3, 3);
     CommandParser parser=new CommandParser();
     bool isPoppable = parser.CheckPoppableBalloon("2 1", field);
     Assert.AreEqual(true, isPoppable);
 }
 public void TestParseCommandTop()
 {
     PlayField field = new PlayField(3, 4);
     CommandParser parser = new CommandParser();
     Command command = parser.ParseCommand("Top", field);
     Assert.AreEqual(Command.Top, command);
 }
 public void TestParseCommandRestart()
 {
     PlayField field = new PlayField(3, 4);
     CommandParser parser = new CommandParser();
     Command command = parser.ParseCommand("Restart", field);
     Assert.AreEqual(Command.Restart, command);
 }
 public void TestParseCommandExitFirstLetterLowerCase()
 {
     PlayField field = new PlayField(3, 4);
     CommandParser parser = new CommandParser();
     Command command = parser.ParseCommand("exit", field);
     Assert.AreEqual(Command.Invalid, command);
 }
 public void TestParseCommandCoordinateForParsing()
 {
     PlayField field = new PlayField(3, 4);
     CommandParser parser = new CommandParser();
     Command command = parser.ParseCommand("2 3", field);
     Assert.AreEqual(Command.CoordinateForParsing, command);
 }
 public void TestCheckParseCommandToRowThree()
 {
     CommandParser parser = new CommandParser();
     int row= parser.ParseCommandToRow("3 5");
     Assert.AreEqual(3, row);
 }
 public void TestCheckParseCommandToColOneMillion()
 {
     CommandParser parser = new CommandParser();
     int col= parser.ParseCommandToCol("3, 1000000");
     Assert.AreEqual(1000000, col);
 }