public void Title_is_empty_if_DataTable_has_empty_string_name() { DataTable dataTable = new DataTable(string.Empty); DataGrid actual = DataGrid.BuildFrom(dataTable); Assert.That(actual.Title, Is.EqualTo(MultilineText.Empty)); }
public void Title_is_Object_name() { List <CustomClass> data = new List <CustomClass>(); DataGrid actual = DataGrid.BuildFrom(data); Assert.That(actual.Title, Is.EqualTo(new MultilineText("CustomClass"))); }
public void Title_is_empty_if_DataTable_has_name_set_to_null() { DataTable dataTable = new DataTable(null); DataGrid actual = DataGrid.BuildFrom(dataTable); Assert.That(actual.Title, Is.EqualTo(MultilineText.Empty)); }
public void Title_is_DataTable_name() { DataTable dataTable = new DataTable("this is data"); DataGrid actual = DataGrid.BuildFrom(dataTable); Assert.That(actual.Title, Is.EqualTo(new MultilineText("this is data"))); }
public void public_get_only_property_generates_one_column() { List <GetOnlyProperty> data = new List <GetOnlyProperty>(); DataGrid actual = DataGrid.BuildFrom(data); Assert.That(actual.Columns.Count, Is.EqualTo(1)); Assert.That(actual.Columns[0].HeaderCell.Content, Is.EqualTo(new MultilineText("Number"))); }
public void column_header_content_is_equal_to_DataTable_column_name_if_caption_is_not_set() { DataTable dataTable = new DataTable(); dataTable.Columns.Add("col1"); DataGrid actual = DataGrid.BuildFrom(dataTable); Assert.That(actual.Columns[0].HeaderCell.Content, Is.EqualTo(new MultilineText("col1"))); }
public void one_column_exists_if_DataTable_has_one_column() { DataTable dataTable = new DataTable(); dataTable.Columns.Add("col1"); DataGrid actual = DataGrid.BuildFrom(dataTable); Assert.That(actual.Columns.Count, Is.EqualTo(1)); }
public void row_contains_two_cells() { List <CustomClass> data = new List <CustomClass> { new CustomClass() }; DataGrid actual = DataGrid.BuildFrom(data); Assert.That(actual.Rows[0].CellCount, Is.EqualTo(2)); }
public void one_row_is_generated_if_one_item_in_list() { List <CustomClass> data = new List <CustomClass> { new CustomClass() }; DataGrid actual = DataGrid.BuildFrom(data); Assert.That(actual.Rows.Count, Is.EqualTo(1)); }
public void first_cell_content_is_equal_to_the_first_cell_value_of_the_DataTable_row__int() { DataTable dataTable = new DataTable(); dataTable.Columns.Add("col1"); dataTable.Rows.Add(15); DataGrid actual = DataGrid.BuildFrom(dataTable); Assert.That(actual.Rows[0][0].Content, Is.EqualTo(new MultilineText("15"))); }
public void second_cell_contains_the_value_of_second_property() { List <CustomClass> data = new List <CustomClass> { new CustomClass { Number = 4, Text = "bla" } }; DataGrid actual = DataGrid.BuildFrom(data); Assert.That(actual.Rows[0][1].Content, Is.EqualTo(new MultilineText("bla"))); }
public void first_cell_content_is_equal_to_the_first_cell_value_of_the_DataTable_row__DateTime() { DataTable dataTable = new DataTable(); dataTable.Columns.Add("col1"); dataTable.Rows.Add(new DateTime(2018, 06, 13)); DataGrid actual = DataGrid.BuildFrom(dataTable); MultilineText expected = new MultilineText(new DateTime(2018, 06, 13)); Assert.That(actual.Rows[0][0].Content, Is.EqualTo(expected)); }
public void column_header_content_is_equal_to_DataTable_column_name_if_caption_is_set_to_string_empty() { DataTable dataTable = new DataTable(); DataColumn dataColumn = new DataColumn("col1") { Caption = string.Empty }; dataTable.Columns.Add(dataColumn); DataGrid actual = DataGrid.BuildFrom(dataTable); Assert.That(actual.Columns[0].HeaderCell.Content, Is.EqualTo(new MultilineText("col1"))); }