public void TestCountOpenedFieldsWhenNoOpened()
 {
     Board board = new Board(2, 3, 1);
     int actual = board.CountOpenedFields();
     Assert.AreEqual(0, actual, "Wrong count of opened fields!");
 }
        public void TestCountOpenedFields2()
        {
            int rows = 5;
            int columns = 10;

            Field[,] fixedFields = new Field[rows, columns];
            for (int i = 0; i < rows; i++)
            {
                for (int j = 0; j < columns; j++)
                {
                    fixedFields[i, j] = new Field();
                }
            }

            fixedFields[0, 0].Status = FieldStatus.Opened;

            Board board = new Board(rows, columns, 10);

            Type type = typeof(Board);
            var fieldValue = type.GetField("fields", BindingFlags.Instance | BindingFlags.NonPublic);
            fieldValue.SetValue(board, fixedFields);

            int expected = 1;
            int actual = board.CountOpenedFields();

            Assert.AreEqual(
                expected,
                actual,
                string.Format("The board opened fields are {0}, but must be {1}!", actual, expected));
        }