public void nQueensTest() { foreach (var testdata in TestDataList) { IList <IList <string> > queens = NQueens.SolveNQueens(testdata.Input); foreach (var output in queens) { foreach (var chessboard in output) { Console.WriteLine(chessboard); } Console.WriteLine("******************"); } } }
public void Test1() { var sol = new NQueens(); var res = sol.SolveNQueens(4); var expected = new List <IList <string> >() { new List <string>() { ".Q..", "...Q", "Q...", "..Q." }, new List <string>() { "..Q.", "Q...", "...Q", ".Q.." }, }; Utlilitiy.AssertAreEqualIgnoreOrder(expected, res); }
public void NQueenTest(int n, bool expected) { Assert.Equal(expected, NQueens.SolveNQueens(n)); }