Exemplo n.º 1
0
        public void cablePuzzleCheckSolved()
        {
            var pieces = new List <string> {
                "01"
            };
            var solutionPath = new List <int> {
                0
            };
            var cp = new CablePuzzleGame(pieces);

            Assert.AreEqual(false, cp.checkSolved(new List <string> {
                "02"
            }, solutionPath));
            Assert.AreEqual(true, cp.checkSolved(pieces, solutionPath));
            cp.pieces[0] = new Piece("03");
            Assert.AreEqual(true, cp.checkSolved(pieces, solutionPath));

            cp = new CablePuzzleGame();

            Assert.AreEqual(false, cp.checkSolved());
            Assert.AreEqual(true, cp.checkSolved(cp.pieces.Select(p => p.getAsString()).ToList()));
        }