public void TestCsvWriterEmpty() { StringWriter stringWriter = new StringWriter(); CSVFileWriter csvFileWriter = new CSVFileWriter(stringWriter); DataTable dataTable = new DataTable(); csvFileWriter.WriteFromDataTable(dataTable); csvFileWriter.Close(); Assert.AreEqual(Environment.NewLine, stringWriter.ToString()); }
public void TestCsvWriterCommasInHeader() { StringWriter stringWriter = new StringWriter(); CSVFileWriter csvFileWriter = new CSVFileWriter(stringWriter); DataTable dataTable = CsvTestsSamples.CommasInHeaderDataTable(); csvFileWriter.WriteFromDataTable(dataTable); csvFileWriter.Close(); string expected = CsvTestsSamples.CommasInHeaderCsvContents(); Assert.AreEqual(expected, stringWriter.ToString()); }