Exemple #1
0
 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());
         }
     }
 }
Exemple #2
0
 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());
         }
     }
 }
Exemple #3
0
 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());
         }
     }
 }
Exemple #4
0
 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());
         }
     }
 }
Exemple #5
0
 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());
         }
     }
 }