コード例 #1
0
        public void DistinctGroupsReturnsZeroWithAllUnknowns()
        {
            Nonogram n = new Nonogram(5, 1);
            CellLine l = n.Row(0);

            Assert.AreEqual(0, l.DistinctGroups());
        }
コード例 #2
0
        public void DistinctGroupsReturnsOneWithAllFilled()
        {
            Nonogram n = new Nonogram(5, 1);
            CellLine l = n.Row(0);

            l.Fill(Cell.CellState.Filled);

            Assert.AreEqual(1, l.DistinctGroups());
        }
コード例 #3
0
        public void DistinctGroupsReturnsZeroWithAllBlank()
        {
            Nonogram n = new Nonogram(5, 1);
            CellLine l = n.Row(0);

            l.Fill(Cell.CellState.Blank);

            Assert.AreEqual(0, l.DistinctGroups());
        }
コード例 #4
0
        public void DistinctGroupsReturnsActualNumberOfGroupsWithThreeGroupsOfOne()
        {
            Nonogram n = new Nonogram(5, 1);
            CellLine l = n.Row(0);

            l[0].State = l[2].State = l[4].State = Cell.CellState.Filled;
            l[1].State = l[3].State = Cell.CellState.Blank;

            Assert.AreEqual(3, l.DistinctGroups());
        }
コード例 #5
0
        public void DistinctGroupsReturnsActualNumberOfGroupsWithTwoGroupsOfTwo()
        {
            Nonogram n = new Nonogram(5, 1);
            CellLine l = n.Row(0);

            l.Fill(Cell.CellState.Filled);
            l[2].State = Cell.CellState.Blank;

            Assert.AreEqual(2, l.DistinctGroups());
        }