Ejemplo n.º 1
0
        public void ShiftColumnDown()
        {
            IGridConfiguration conf = CreateTestConfig();
            IGrid grid = new SquareGrid(conf);

            List <ICellContent> contents = new List <ICellContent>(conf.ColumnCount * conf.RowCount);

            FillColumnContents(grid, contents);

            Assert.AreSame(contents[0], grid.Columns[0][0].Content);
            Assert.AreSame(contents[1], grid.Columns[0][1].Content);
            ICellContent firstRowContent = grid.Columns[0][0].Content;

            grid.Accept(new ColumnDownShifter(0, 3));

            Assert.AreSame(firstRowContent, grid.Columns[0][3].Content);

            grid.Accept(new ColumnDownShifter(0, 10));

            Assert.AreSame(firstRowContent, grid.Columns[0][3].Content);

            grid.Accept(new ColumnDownShifter(0, 13));

            Assert.AreSame(firstRowContent, grid.Columns[0][1].Content);
        }