Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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")));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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")));
        }
Esempio n. 5
0
        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")));
        }
Esempio n. 6
0
        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")));
        }
Esempio n. 7
0
        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));
        }
Esempio n. 8
0
        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));
        }
Esempio n. 9
0
        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));
        }
Esempio n. 10
0
        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")));
        }
Esempio n. 11
0
        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")));
        }
Esempio n. 12
0
        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));
        }
Esempio n. 13
0
        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")));
        }