Exemplo n.º 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);
        }
Exemplo n.º 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();
 }
Exemplo n.º 3
0
 public void TestToStringSecondTest()
 {
     GameField gamefield = new GameField(4);
     Assert.IsTrue(gamefield.ToString().Contains("|"));
 }
Exemplo n.º 4
0
 public void TestToString()
 {
     GameField gamefield = new GameField(4);
     Assert.IsTrue(gamefield.ToString().StartsWith(" -------------"));
 }
Exemplo n.º 5
0
 public void TestMoveCounterStartValue()
 {
     GameField gamefield = new GameField(4);
     Assert.AreEqual(0, gamefield.MoveCounter);
 }
Exemplo n.º 6
0
 public void TestIsCurrentMatrixArranged()
 {
     GameField gamefield = new GameField(4);
     Assert.IsFalse(gamefield.IsCurrentMatrixArranged());
 }
Exemplo n.º 7
0
 public void InitializeFieldWithNegativeSize()
 {
     GameField gamefield = new GameField(-2);
 }
Exemplo n.º 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();
 }