Beispiel #1
0
        public void AddGridTest2()
        {
            SudokuPuzzleBase target   = CreateSudokuPuzzleBase();
            Keys <int>       expected = new Keys <int>()
            {
                67, 68, 69, 88, 89, 90, 109, 110, 111
            };
            int xOffset = 3;
            int yOffset = 3;
            int xSize   = 3;
            int ySize   = 3;
            int xWidth  = 21;
            IConstraints <int> constraints = new Constraints <int>();

            target.AddGrid(xOffset, yOffset, xSize, ySize, xWidth, constraints);
            Assert.AreEqual(1, constraints.Count, "Constraint not created");
            Keys <int> keysOut = constraints.First().Keys;

            Assert.AreEqual(9, keysOut.Count, "Incorrect key count in grid");
            Assert.IsTrue(keysOut.SetEquals(expected), "Set does not match");
        }
Beispiel #2
0
        public void AddGridTest()
        {
            SudokuPuzzleBase target   = CreateSudokuPuzzleBase();
            Keys <int>       expected = new Keys <int>()
            {
                13, 14, 15, 34, 35, 36, 55, 56, 57
            };
            int xOffset = 12;
            int yOffset = 0;
            int xSize   = 3;
            int ySize   = 3;
            int xWidth  = 21;
            IConstraints <int> constraints = new Constraints <int>();

            target.AddGrid(xOffset, yOffset, xSize, ySize, xWidth, constraints);
            Assert.AreEqual(1, constraints.Count, "Constraint not created");
            Keys <int> keysOut = constraints.First().Keys;
            string     name    = constraints.First().Name;

            Assert.AreEqual(9, keysOut.Count, "Incorrect key count in grid");
            Assert.IsTrue(keysOut.SetEquals(expected), "Set does not match");
            Assert.AreEqual("Grid 5,1: At 13", name, "Column name does not match");
        }