// [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); }
public override string ToString() { CsvHelper helper = new CsvHelper(); return(string.Join(",", helper.EscapeAll(this.OnDate, this.FileName, this.OriginalSizeBytes, this.NewSizeBytes, this.CalcPercentageSavings()))); }
public override string ToString() { CsvHelper helper = new CsvHelper(); return string.Join(",", helper.EscapeAll(this.OnDate, this.FileName, this.OriginalSizeBytes, this.NewSizeBytes, this.CalcPercentageSavings())); }
public void EscapesQuotes() { string str = "foo bar\"double"; string escapedStr = new CsvHelper().Escape(str); string expectedStr = "\"foo bar\"\"double\""; Assert.AreEqual(expectedStr,escapedStr); }
public void EscapesComma() { string str = "foo bar, comma"; string escapedStr = new CsvHelper().Escape(str); string expectedStr = "\"foo bar, comma\""; Assert.AreEqual(expectedStr, escapedStr); }
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); }
public void DoesNotModifyNormalCharatersTest1() { string str = "no escaping here"; string escapedStr = new CsvHelper().Escape(str); Assert.AreEqual(str, escapedStr); }