public void ChangeHetmansTest()
        {
            // prepare data
            int[] positionInColumns              = new int[] { 0, 2, 1, 3 };
            int[] countHetmanInRow               = new int[] { 1, 1, 1, 1 };
            int[] countHetmanToLeftDownDiagonal  = new int[] { 1, 0, 0, 2, 0, 0, 1 };
            int[] countHetmanToRightDownDiagonal = new int[] { 0, 0, 1, 2, 1, 0, 0 };
            int   unvisitedField = -1;
            int   chessBoardSize = 4;

            int hetman1 = 1;
            int hetman2 = 3;
            int row1    = positionInColumns[hetman1];
            int row2    = positionInColumns[hetman2];

            // data to assert
            int[] expectedCountHetmanToLeftDownDiagonal  = new int[] { 1, 0, 0, 1, 1, 1, 0 };
            int[] expectedCountHetmanToRightDownDiagonal = new int[] { 0, 1, 0, 1, 2, 0, 0 };

            // action
            // remove hetmans
            ChessBoardHelper.SetHetman(positionInColumns, countHetmanInRow, countHetmanToLeftDownDiagonal, countHetmanToRightDownDiagonal,
                                       hetman1, row1, false, unvisitedField, chessBoardSize);

            ChessBoardHelper.SetHetman(positionInColumns, countHetmanInRow, countHetmanToLeftDownDiagonal, countHetmanToRightDownDiagonal,
                                       hetman2, row2, false, unvisitedField, chessBoardSize);

            // set hetmans on new positions
            ChessBoardHelper.SetHetman(positionInColumns, countHetmanInRow, countHetmanToLeftDownDiagonal, countHetmanToRightDownDiagonal,
                                       hetman1, row2, true, unvisitedField, chessBoardSize);

            ChessBoardHelper.SetHetman(positionInColumns, countHetmanInRow, countHetmanToLeftDownDiagonal, countHetmanToRightDownDiagonal,
                                       hetman2, row1, true, unvisitedField, chessBoardSize);

            // asserts
            // position in columns
            Assert.AreEqual(positionInColumns[hetman1], 3, "First hetman bad position");
            Assert.AreEqual(positionInColumns[hetman2], 2, "Second hetman bad position");

            // count hetman in row
            Assert.AreEqual(countHetmanInRow[2], 1, "Third row has not 1 hetman");
            Assert.AreEqual(countHetmanInRow[3], 1, "Fourth row has not 1 hetman");

            // position in diagonals
            for (int i = 0; i < (chessBoardSize * 2) - 1; i++)
            {
                Assert.AreEqual(countHetmanToLeftDownDiagonal[i], expectedCountHetmanToLeftDownDiagonal[i], $"{i} left diagonal is wrong, values: " +
                                $"{countHetmanToLeftDownDiagonal[i]}, expected: {expectedCountHetmanToLeftDownDiagonal[i]}");
            }

            for (int i = 0; i < (chessBoardSize * 2) - 1; i++)
            {
                Assert.AreEqual(countHetmanToRightDownDiagonal[i], expectedCountHetmanToRightDownDiagonal[i], $"{i} right diagonal is wrong, values: " +
                                $"{countHetmanToRightDownDiagonal[i]}, expected: {expectedCountHetmanToRightDownDiagonal[i]}");
            }
        }
        private void SetUpChessBoardRandomly()
        {
            Random rand = new Random();

            var randomRowsInColumns = new List <int>();

            randomRowsInColumns.AddRange(Enumerable.Range(0, _chessBoardSize)
                                         .OrderBy(i => rand.Next())
                                         .Take(_chessBoardSize));


            for (int i = 0; i < randomRowsInColumns.Count; i++)
            {
                ChessBoardHelper.SetHetman(_positionInColumns, _countHetmanInRow, _countHetmanToLeftDownDiagonal, _countHetmanToRightDownDiagonal, i,
                                           randomRowsInColumns[i], true, _unvisitedField, _chessBoardSize);
            }
        }
        private void ChangeHetmansInChessBoard(int[] positionInColumns, int[] countHetmanInRow, int[] countHetmanToLeftDownDiagonal,
                                               int[] countHetmanToRightDownDiagonal, int hetman1, int hetman2)
        {
            int row1 = positionInColumns[hetman1];
            int row2 = positionInColumns[hetman2];

            // remove hetmans
            ChessBoardHelper.SetHetman(positionInColumns, countHetmanInRow, countHetmanToLeftDownDiagonal, countHetmanToRightDownDiagonal,
                                       hetman1, row1, false, _unvisitedField, _chessBoardSize);

            ChessBoardHelper.SetHetman(positionInColumns, countHetmanInRow, countHetmanToLeftDownDiagonal, countHetmanToRightDownDiagonal,
                                       hetman2, row2, false, _unvisitedField, _chessBoardSize);

            // set hetmans on new positions
            ChessBoardHelper.SetHetman(positionInColumns, countHetmanInRow, countHetmanToLeftDownDiagonal, countHetmanToRightDownDiagonal,
                                       hetman1, row2, true, _unvisitedField, _chessBoardSize);

            ChessBoardHelper.SetHetman(positionInColumns, countHetmanInRow, countHetmanToLeftDownDiagonal, countHetmanToRightDownDiagonal,
                                       hetman2, row1, true, _unvisitedField, _chessBoardSize);
        }
        public void SetHetmanNQueenPermutationsTest()
        {
            // prepare data
            int[] positionInColumns              = new int[] { 0, 2, 1, 3 };
            int[] countHetmanInRow               = new int[] { 1, 1, 1, 1 };
            int[] countHetmanToLeftDownDiagonal  = new int[] { 1, 0, 0, 2, 0, 0, 1 };
            int[] countHetmanToRightDownDiagonal = new int[] { 0, 0, 1, 2, 1, 0, 0 };
            int   unvisitedField = -1;
            int   chessBoardSize = 4;

            int hetman = 0;
            int row    = positionInColumns[hetman];

            // make action
            ChessBoardHelper.SetHetman(positionInColumns, countHetmanInRow, countHetmanToLeftDownDiagonal, countHetmanToRightDownDiagonal,
                                       hetman, row, false, unvisitedField, chessBoardSize);

            // asserts
            Assert.AreEqual(positionInColumns[hetman], -1, "positionInColumns is bad");
            Assert.AreEqual(countHetmanInRow[0], 0, "CountHetmanInRow is bad");
            Assert.AreEqual(countHetmanToLeftDownDiagonal[0], 0, "LeftDownDiagonal is bad");
            Assert.AreEqual(countHetmanToRightDownDiagonal[4], 1, "RightDownDiagonal is bad");
        }