public void NullValuesShouldBeEmptyStrings() { var sut = new CSVFormatter(); var result = sut.FormatLine(new List <string> { "value a", null, "value c" }); result.ShouldBe("value a,,value c"); }
public void LineFeedValuesShouldBeSurroundedWithQuotes() { var sut = new CSVFormatter(); var result = sut.FormatLine(new List <string> { "value a", "value b", "value c", "value d\rvalue e\rvalue f" }); result.ShouldBe("value a,value b,value c,\"value d\rvalue e\rvalue f\""); }
public void CommaValuesShouldBeSurroundedWithQuotes() { var sut = new CSVFormatter(); var result = sut.FormatLine(new List <string> { "value a", "value,b", "value c", "value d" }); result.ShouldBe("value a,\"value,b\",value c,value d"); }
public void QuotedValuesShouldBeSurroundedWithQuotes() { var sut = new CSVFormatter(); var result = sut.FormatLine(new List <string> { "value a", "\"value b\"", "value\"c", "value d" }); result.ShouldBe("value a,\"\"\"value b\"\"\",\"value\"\"c\",value d"); }
public void NormalValuesShouldBeCommaDelimited() { var sut = new CSVFormatter(); var result = sut.FormatLine(new List <string> { "value a", "value b", "value c", "value d" }); result.ShouldBe("value a,value b,value c,value d"); }