public SqlServerWriterTests() { var row = new dcp.lib.Row(); row.Add(1); row.Add("two"); row.Add(new DateTime(1961, 3, 14, 1, 2, 3)); rows.Add(row); }
private Row readRow(SqlDataReader reader) { var row = new dcp.lib.Row(); for (var columnNumber = startColumnNumber; columnNumber <= endColumnNumber; columnNumber++) { row.Add(reader[columnNumber]); // the 0 row is the row number, which we don't want } nextRowNumber += 1; return(row); }
public CsvWriterTests() { row1 = new dcp.lib.Row(); row1.Add(1); row1.Add("two"); row1.Add(new DateTime(1961, 3, 14, 1, 2, 3)); row2 = new dcp.lib.Row(); row2.Add(1); row2.Add("two"); row2.Add(new DateTime(1961, 3, 14, 1, 2, 3)); stream = File.Create(TESTFILE); }
public void EscapesNewLine() { var row = new dcp.lib.Row(); row.Add("newline\nstring"); var opts = new dcp.lib.DataCopier.Options(); var rows = new List <dcp.lib.Row>() { row }; writeRows(opts, rows); Assert.Equal("\"newline\nstring\"\r\n", getResult()); }