public void CSVWriterTest() { DataTable table = new DataTable("sheet1"); table.Columns.Add("ColumnA"); table.Columns.Add("ColumnB"); for (int i = 0; i < 100; i++) { var row = table.NewRow(); row[0] = "111"; row[1] = 222; table.Rows.Add(row); } ExcelTool.CSVWriter(table, path); bool exists = File.Exists(path); Assert.AreEqual(exists, true); }