Пример #1
0
        public void TestFixedItems()
        {
            List <CellContent> contentlist = new List <CellContent>
            {
                new CellContent(0),       // 0, 0
                new CellContent(1, true), // 0, 1
                new CellContent(0),       // 0, 2
                new CellContent(2),       // 1, 0
                new CellContent(0),       // 1, 1
                new CellContent(3),       // 1, 2
                new CellContent(9, true), // 2, 0
                new CellContent(4),       // 2, 1
                new CellContent(5),       // 2, 2
            };

            SudokuItem item = new SudokuItem(contentlist);

            Assert.IsTrue(item[1].IsFixed);

            item.ReplaceItem(new CellContent(1), 1);
            Assert.AreEqual(new CellContent(1), item[1]);
            Assert.IsTrue(item[1].IsFixed);
            Assert.IsFalse(item[1].IsEmpty);

            item.ReplaceItem(new CellContent(7), 1);

            Assert.AreEqual(new CellContent(1), item[1]);
        }