Example #1
0
        public void BestBookOpeningTest()
        {
            var subset = new List <string>
            {
                @"\MB,B",
                @"\MB,B",
                @"\MB,W",
                @"\MB,W",
                @"\MC,W",
                @"\MC,W",
                @"\MD,B",
                @"\MD,B",
                @"\MD,W",
            };

            var gameStateStats = new Dictionary <short, PlayStats>
            {
                { 0, new PlayStats(subset.Count, subset, @"\M", 'B') },
                { 1, new PlayStats(subset.Count, subset, @"\M", 'C') },
                { 2, new PlayStats(subset.Count, subset, @"\M", 'D') },
            };

            var depthFirstSearch = new DepthFirstSearch();

            var bestIndexBlack = depthFirstSearch.BestBookPlay(gameStateStats, 0);

            Assert.AreEqual((short)2, bestIndexBlack);

            var bestIndexWhite = depthFirstSearch.BestBookPlay(gameStateStats, 1);

            Assert.AreEqual((short)1, bestIndexWhite);
        }