public void ExecuteTest()
            {
                // Create the mock engine
                MockChessEngine engine = new MockChessEngine();
                // Create the 'new game' command
                UciNewGameCommand command = new UciNewGameCommand();

                // Execute against the mock
                command.Execute(engine);
                // Verify commands sent
                Trace.WriteLine(String.Format("Verifying UciNewGameCommand sends correct command to the engine..."));
                Assert.AreEqual(engine.CommandString, UCIChessEngine.UciNewGame);
                Assert.AreEqual(engine.ExpectedResponse, String.Empty);
            }
Ejemplo n.º 2
0
        public UciClient(InteractiveConsole interactiveConsole)
        {
            BoardState = new BoardState();
            BoardState.SetDefaultState();

            _interactiveConsole = interactiveConsole;

#if UCI_DEBUG_OUTPUT
            _debugMode = true;
#endif

            _commands               = new Dictionary <string, IUciCommand>();
            _commands["quit"]       = new QuitCommand(this);
            _commands["setoption"]  = new SetOptionCommand(this);
            _commands["isready"]    = new IsReadyCommand(this);
            _commands["ucinewgame"] = new UciNewGameCommand(this);
            _commands["position"]   = new PositionCommand(this);
            _commands["debug"]      = new DebugCommand(this);
            _commands["go"]         = new GoCommand(this);
            _commands["stop"]       = new StopCommand(this);

            IterativeDeepening.OnSearchUpdate += OnSearchUpdate;
        }