コード例 #1
0
        public void TestTwoSolutionGameCounting()
        {
            var solverCounting = new SolverFactory().GenerateSolver(true);
            var game           = new GameFactoryForTesting().GenerateGameTwoSolutions();

            Assert.IsFalse(game.IsSolved);
            int numSolutions = solverCounting.Solve(game);

            Assert.IsTrue(game.IsSolved);
            Assert.AreEqual(2, numSolutions);
        }
コード例 #2
0
        public void TestAllGamesCounting()
        {
            var solver   = new SolverFactory().GenerateSolver(true);
            var database = new DatabaseFactory().GetDatabase();

            foreach (var databaseGame in database.GetAllGames(null))
            {
                Assert.IsFalse(databaseGame.Game.IsSolved);

                int numSolutions = solver.Solve(databaseGame.Game);

                Assert.IsTrue(databaseGame.Game.IsSolved);
                Assert.AreEqual(1, numSolutions);
            }
        }