Esempio n. 1
0
        public void ShouldGetNextMoveAsBlackWithDepthOne()
        {
            var connector = new UCIConnector(_setting);

            connector.Connect();

            var move1 = connector.GetNextMove("", 1);
            var move2 = connector.GetNextMove("e2e4 d7d5", 1);

            connector.Disconnect();

            StringAssert.IsMatch(MOVE_REGEX_PATTERN, move1);
            StringAssert.IsMatch(MOVE_REGEX_PATTERN, move2);
        }
Esempio n. 2
0
        public void ShouldThrowNotConnectedException()
        {
            var connector = new UCIConnector(_setting);

            Assert.IsFalse(connector.IsConnected);
            Assert.Throws <UCIConnectionException>(() => connector.GetNextMove("d2d4", 5));
            Assert.Throws <UCIConnectionException>(() => connector.ConfigureEngine());
            Assert.Throws <UCIConnectionException>(() => connector.StartGame());
        }
Esempio n. 3
0
        public void ShouldGetNextMoveAsWhiteWithDepthOne()
        {
            var connector = new UCIConnector(_setting);

            connector.Connect();

            var move = connector.GetNextMove("e2e4", 1);

            connector.Disconnect();

            StringAssert.IsMatch(MOVE_REGEX_PATTERN, move);
        }