Exemplo n.º 1
0
        public void ShouldCheckForWinAndNotMatch()
        {
            var hardPuzzle = new HardPuzzle();

            Assert.IsInstanceOfType(hardPuzzle, typeof(HardPuzzle));
            Assert.IsInstanceOfType(hardPuzzle, typeof(Puzzle));
            hardPuzzle.CreatePuzzle();
            Assert.IsNotNull(hardPuzzle.PuzzleArray);

            var result = hardPuzzle.Check();

            Assert.IsFalse(result);
        }
Exemplo n.º 2
0
        public void CreateAHardPuzzleFromGenerator()
        {
            var hardPuzzle = new HardPuzzle();

            Assert.IsInstanceOfType(hardPuzzle, typeof(HardPuzzle));
            Assert.IsInstanceOfType(hardPuzzle, typeof(Puzzle));
            hardPuzzle.CreatePuzzle();
            Assert.IsNotNull(hardPuzzle.PuzzleArray);
            BuildLogString(hardPuzzle.PuzzleArray);
            WriteLog();
            Assert.IsTrue(_log.Contains("0"));
            Assert.AreEqual((int)Difficulty.Hard, _log.Count(s => s == '0'));
        }