Esempio n. 1
0
        private TableGrid CreateGrid(int rows, int columns)
        {
            var grid = new TableGrid();
            grid.Rows = rows;
            grid.Columns = columns;

            grid.StartIndex = new TableIndex(0, 0);
            grid.EndIndex = new TableIndex(rows, columns);

            return grid;
        }
Esempio n. 2
0
        private Table<SelectableGraphicComponentMock> FillGrid(TableGrid grid)
        {
            var components = new Table<SelectableGraphicComponentMock>();

            for (int row = 0; row < grid.Rows; row++)
            {
                for (int column = 0; column < grid.Columns; column++)
                {
                    var component = new SelectableGraphicComponentMock();
                    components[row, column] = component;
                    grid.SetComponentAt(row, column, component);
                }
            }

            return components;
        }
Esempio n. 3
0
        public void Draw_ResetEndToNotNull_DrawNothing()
        {
            var grid = new TableGrid(ROWS, COLUMNS);
            var components = FillGrid(grid);

            grid.EndIndex = null;
            grid.EndIndex = new TableIndex(0, 0);
            grid.Draw();

            foreach (var component in components)
                Assert.IsFalse(component.WasDrawn);

        }
Esempio n. 4
0
        public void Draw_EndIndexNull_DrawAll()
        {
            var grid = new TableGrid(ROWS, COLUMNS);
            var components = FillGrid(grid);

            grid.EndIndex = null;
            grid.Draw();

            foreach (var component in components)
                Assert.IsTrue(component.WasDrawn);
            
        }
Esempio n. 5
0
        public void EndIndex_Default_0_0()
        {
            TableIndex defaultEndIndex = new TableIndex(0, 0);
            var grid = new TableGrid(ROWS, COLUMNS);

            Assert.IsTrue(grid.EndIndex.HasValue);
            AssertIndicesAreEqual(defaultEndIndex, grid.EndIndex.Value);
        }
Esempio n. 6
0
        private TableView<Object> CreateTable(Mock<ITableModel<Object>> modelMock, TableRendererMock<Object> renderer, Mock<ITableSelectionModel> selectionModelMock, ITableGrid grid = null)
        {
            if (grid == null)
                grid = new TableGrid();

            var table = new TableView<Object>(modelMock.Object, renderer, selectionModelMock.Object, grid);
            table.SetCoordinates(0, 0, 500, 500);
            return table;
        }