Ejemplo n.º 1
0
        public void parent_column_has_padding_right()
        {
            DataGrid dataGrid = new DataGrid();
            Column   column   = new Column(string.Empty)
            {
                PaddingLeft  = 0,
                PaddingRight = 2
            };

            dataGrid.Columns.Add(column);
            DataRow row = new DataRow();

            dataGrid.Rows.Add(row);
            DataCell cell = new DataCell("text")
            {
                HorizontalAlignment = HorizontalAlignment.Right
            };

            row.AddCell(cell);
            Size size = new Size(10, 1);

            List <string> actual = cell.Render(size).ToList();

            Assert.That(actual, Is.EqualTo(new List <string> {
                "    text  "
            }));
        }
Ejemplo n.º 2
0
        public void content_is_longer_than_required_width()
        {
            DataCell cell = new DataCell("some long text");
            Size     size = new Size(10, 1);

            List <string> actual = cell.Render(size).ToList();

            Assert.That(actual, Is.EqualTo(new List <string> {
                "some long text"
            }));
        }
Ejemplo n.º 3
0
        public void content_is_longer_than_required_height()
        {
            DataCell cell = new DataCell(new MultilineText(new[] { "line1", "line2", "line3" }));
            Size     size = new Size(10, 2);

            List <string> actual = cell.Render(size).ToList();

            Assert.That(actual, Is.EqualTo(new List <string>
            {
                "line1     ",
                "line2     "
            }));
        }
Ejemplo n.º 4
0
        public void content_is_shorter_than_required_height()
        {
            DataCell cell = new DataCell("text");
            Size     size = new Size(10, 2);

            List <string> actual = cell.Render(size).ToList();

            Assert.That(actual, Is.EqualTo(new List <string>
            {
                "text      ",
                "          "
            }));
        }
Ejemplo n.º 5
0
        public void cell_has_padding_left()
        {
            DataGrid dataGrid = new DataGrid();
            DataRow  row      = new DataRow();

            dataGrid.Rows.Add(row);
            DataCell cell = new DataCell("text")
            {
                PaddingLeft  = 2,
                PaddingRight = 0
            };

            row.AddCell(cell);
            Size size = new Size(10, 1);

            List <string> actual = cell.Render(size).ToList();

            Assert.That(actual, Is.EqualTo(new List <string> {
                "  text    "
            }));
        }