コード例 #1
0
        public void Can_Solve_8_Queen_Pussel()
        {
            var pussel = new ChessQueens(8);

            pussel.SolveByForce();
            Assert.IsTrue(pussel.Solved);
        }
コード例 #2
0
        public void Can_Check_Wrong_Solution_Diagonally()
        {
            var pussel = new ChessQueens(4);
            var rows   = new List <int[]>()
            {
                new int[] { 1, 0, 0, 0 },
                new int[] { 0, 1, 0, 0 },
                new int[] { 0, 0, 0, 1 },
                new int[] { 0, 0, 1, 0 }
            };

            Assert.IsFalse(pussel.CheckIfSolved(rows));
        }
コード例 #3
0
        public void Can_Check_Correct_Solution()
        {
            var pussel = new ChessQueens(4);
            var rows   = new List <int[]>()
            {
                new int[] { 0, 1, 0, 0 },
                new int[] { 0, 0, 0, 1 },
                new int[] { 1, 0, 0, 0 },
                new int[] { 0, 0, 1, 0 }
            };

            Assert.IsTrue(pussel.CheckIfSolved(rows));
        }