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 " })); }
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" })); }
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 " })); }
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 ", " " })); }
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 " })); }