public void TryTextCsvWriter12() { using (var sw = new StringWriter()) { using (var w = new TextCsvWriter(sw, new TextCsvSettings() { Quotation = CsvQuotation.Forced, Quote = '\"', Delemiter = ',' })) { w.WriteRow(new string[] { null }); Assert.AreEqual("\"\"\r\n", w.BaseWriter.ToString()); } } }
public void TryTextCsvWriter10() { using (var sw = new StringWriter()) { using (var w = new TextCsvWriter(sw, new TextCsvSettings() { Quotation = CsvQuotation.Normal, Quote = '\"', Delemiter = ',' })) { w.WriteRow(new string[] { "normal ", "\"Quote\"" }); Assert.AreEqual("normal ,\"\"\"Quote\"\"\"\r\n", w.BaseWriter.ToString()); } } }
public void TryTextCsvWriter07() { using (var sw = new StringWriter()) { using (var w = new TextCsvWriter(sw, new TextCsvSettings() { Quotation = CsvQuotation.ForceText, Quote = '\"', Delemiter = ',', HeaderRow = 0 })) { w.WriteRow(new string[] { "\"This is a \"Quote\"\"" }); Assert.AreEqual("\"This is a \"Quote\"\"\r\n", w.BaseWriter.ToString()); } } }
public void TryTextCsvWriter09() { using (var sw = new StringWriter()) { using (var w = new TextCsvWriter(sw, new TextCsvSettings() { Quotation = CsvQuotation.None, Quote = '\'', Delemiter = ',' })) { w.WriteRow(new string[] { "No \'Quote\'" }); Assert.AreEqual("No \'Quote\'\r\n", w.BaseWriter.ToString()); } } }
public void TryTextCsvWriter05() { using (var sw = new StringWriter()) { using (var w = new TextCsvWriter(sw, new TextCsvSettings() { Quotation = CsvQuotation.ForceText, Quote = '\'', Delemiter = ',', HeaderRow = 0 })) { w.WriteRow(new string[] { "\'ForcedText\' ", "123" }); Assert.AreEqual("\'ForcedText\' ,123\r\n", w.BaseWriter.ToString()); } } }