Esempio n. 1
0
        public void CellAccessedThroughRowAndColumnAreTheSameAsThroughTheIndexer()
        {
            const int width  = 7;
            const int column = 5;

            const int height = 3;
            const int row    = 1;

            Nonogram n = new Nonogram(width, height);

            Cell c = n[column, row];

            Assert.AreSame(c, n.Row(row)[column]);
            Assert.AreSame(c, n.Column(column)[row]);
        }
Esempio n. 2
0
        public void ModifyingAColumnCellLineModifiesTheNonogramCell()
        {
            const int width  = 5;
            const int column = 3;

            const int height = 5;
            const int row    = 3;

            Nonogram n = new Nonogram(width, height);

            Cell c = n[column, row];

            n.Column(column)[row].State = Cell.CellState.Filled;

            Assert.AreEqual(Cell.CellState.Filled, c.State);
        }
Esempio n. 3
0
        public void AccessingOnePastOutOfBoundsColumnThrowsOutOfRangeException()
        {
            Nonogram n = new Nonogram(5, 5);

            try
            {
                var r = n.Column(5);
                Assert.Fail();
            }
            catch (IndexOutOfRangeException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }
        }
Esempio n. 4
0
        public void ModifyingACloneColumnCellLineModifiesTheNonogramCell()
        {
            const int width  = 5;
            const int column = 3;

            const int height = 5;
            const int row    = 3;

            Nonogram n = new Nonogram(width, height);

            var original = n.Column(column);
            var clone    = original.Clone();

            clone[row].State = Cell.CellState.Filled;

            Assert.AreEqual(original[row].State, clone[row].State);
        }