Exemple #1
0
        public void TestMoveCounter()
        {
            GameField gamefield = new GameField(4);
            int successMoveCount = 0;
            if (gamefield.MakeMove(12))
            {
                successMoveCount++;
            }

            if (gamefield.MakeMove(1))
            {
                successMoveCount++;
            }

            Assert.AreEqual(successMoveCount, gamefield.MoveCounter);
        }
Exemple #2
0
 /// <summary>
 ///Initializes a new instance of the <see cref="GameEngine"/> class. Sets base parameters for new game, scoreboard and field.
 /// </summary>
 public GameEngine()
 {
     this.scoreBoard = new ScoreBoard();
     this.field = new GameField(Size);
     renderer = new GameRenderer();
 }
Exemple #3
0
 public void TestToStringSecondTest()
 {
     GameField gamefield = new GameField(4);
     Assert.IsTrue(gamefield.ToString().Contains("|"));
 }
Exemple #4
0
 public void TestToString()
 {
     GameField gamefield = new GameField(4);
     Assert.IsTrue(gamefield.ToString().StartsWith(" -------------"));
 }
Exemple #5
0
 public void TestMoveCounterStartValue()
 {
     GameField gamefield = new GameField(4);
     Assert.AreEqual(0, gamefield.MoveCounter);
 }
Exemple #6
0
 public void TestIsCurrentMatrixArranged()
 {
     GameField gamefield = new GameField(4);
     Assert.IsFalse(gamefield.IsCurrentMatrixArranged());
 }
Exemple #7
0
 public void InitializeFieldWithNegativeSize()
 {
     GameField gamefield = new GameField(-2);
 }
Exemple #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameEngine"/> class. Sets base parameters for new game, scoreboard and field.
 /// </summary>
 public GameEngine()
 {
     this.scoreBoard = new ScoreBoard();
     this.field      = new GameField(Size);
     this.renderer   = new GameRenderer();
 }