Exemple #1
0
        public void CsvTable_AddHeader_ByName_NullHeader()
        {
            var    table      = new CsvTable();
            string headerName = null;

            Assert.Throws <ArgumentNullException>(() => table.AddHeader(headerName));
        }
Exemple #2
0
        public void CsvTable_HasColumn_NullArgument()
        {
            var    table      = new CsvTable();
            string headerName = "test";

            table.AddHeader(headerName);

            Assert.False(table.HasColumn(null));
        }
Exemple #3
0
        public void CsvTable_HasColumn_Success()
        {
            var    table      = new CsvTable();
            string headerName = "test";

            table.AddHeader(headerName);

            Assert.True(table.HasColumn(headerName));
        }
Exemple #4
0
        public void CsvTable_HasColumn_HeaderDoesNotExist()
        {
            var    table                 = new CsvTable();
            string headerName            = "test";
            string nonExistingheaderName = "iDontExist";

            table.AddHeader(headerName);

            Assert.False(table.HasColumn(nonExistingheaderName));
        }
Exemple #5
0
        public void CsvTable_GetHeader_ByIndex_Success()
        {
            var    table      = new CsvTable();
            string headerName = "test";

            table.AddHeader(headerName);

            CsvHeader returnedHeader = table.GetHeader(0);

            Assert.Equal(headerName, returnedHeader.Name);
            Assert.Equal(0, returnedHeader.Index);
        }