예제 #1
0
        public void GetMoveResponse_ShouldReturnMove_g3g6WithScore_28997()
        {
            // arrange
            var fen              = "2rr3k/pp3pp1/1nnqbN1p/3pN3/2pP4/2P3Q1/PPB4P/R4RK1 w - -";
            var depth            = 6;
            var expectedResponse = "g3g6;28997";

            // act
            var actualResponse = _sut.GetMoveResponse(fen, depth);

            // assert
            Assert.Equal(expectedResponse, actualResponse);
        }
예제 #2
0
 public ChessEngineResult Get(string fen, int depth)
 {
     try
     {
         Console.WriteLine("{0} - parsing fen\n{1}", DateTime.Now, fen);
         var service      = new ChessService();
         var moveResponse = service.GetMoveResponse(fen, depth);
         Console.WriteLine("{0} - generated move:{1}", DateTime.Now, moveResponse);
         return(ChessEngineResult.New(moveResponse));
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(new ChessEngineResult {
             ErrorMessage = e.Message
         });
     }
 }