Beispiel #1
0
        public void TestCalcul2x2()
        {
            Calcul calcul = new Calcul();
            Size   sz     = new Size(2, 2);
            List <IList <int> > positionsGagnantes = new List <IList <int> >();

            positionsGagnantes.Add(new int[] { 2, 3 });
            int handler = calcul.ComputeDock(sz, 2, positionsGagnantes);
            // Cette position est celle qui demande le plus grand nombre de mouvements pour sa résolution : 6
            IList <int> position         = new int[] { 1, 0 };
            IList <int> solution         = calcul.GetSolution(handler, position);
            IList <int> solutionAttendue = new int[] { 1, 3, 2, 0, 1, 3 };

            Assert.AreEqual(solution.Count, solutionAttendue.Count);
            for (int i = 0; i < solution.Count; i++)
            {
                Assert.AreEqual(solution[i], solutionAttendue[i]);
            }
        }