Example #1
0
            // [TestMethod]
            public void EscapesNewLineCharacters1() {
                string str =
@"foo bar
New line";
                string escapedStr = new CsvHelper().Escape(str);

                string expetedStr = string.Format("\"foo bar{0}New line\"",Environment.NewLine);

                Assert.AreEqual(expetedStr, escapedStr);
            }
Example #2
0
        public override string ToString()
        {
            CsvHelper helper = new CsvHelper();

            return(string.Join(",", helper.EscapeAll(this.OnDate, this.FileName, this.OriginalSizeBytes, this.NewSizeBytes, this.CalcPercentageSavings())));
        }
Example #3
0
 public override string ToString() {            
     CsvHelper helper = new CsvHelper();
     return string.Join(",", helper.EscapeAll(this.OnDate, this.FileName, this.OriginalSizeBytes, this.NewSizeBytes, this.CalcPercentageSavings()));
 }
Example #4
0
 public void EscapesQuotes() {
     string str = "foo bar\"double";
     string escapedStr = new CsvHelper().Escape(str);
     string expectedStr = "\"foo bar\"\"double\"";
     Assert.AreEqual(expectedStr,escapedStr);
 }
Example #5
0
 public void EscapesComma() {
     string str = "foo bar, comma";
     string escapedStr = new CsvHelper().Escape(str);
     string expectedStr = "\"foo bar, comma\"";
     Assert.AreEqual(expectedStr, escapedStr);
 }
Example #6
0
 public void EscapesNewLineCharaters3() {
     string str = "foo bar\r new line";
     string escapedStr = new CsvHelper().Escape(str);
     string expectedStr = "\"foo bar\r new line\"";
     Assert.AreEqual(expectedStr, escapedStr);
 }
Example #7
0
            public void DoesNotModifyNormalCharatersTest1() {
                string str = "no escaping here";
                string escapedStr = new CsvHelper().Escape(str);

                Assert.AreEqual(str, escapedStr);
            }