public void Can_generate_csv_with_invalid_chars() { var fields = new[] { "1", "2", "3\"", "4", "5\"five,six\"", "7,7.1", "\"7,7.1\"", "8" }; var csv = TypeSerializer.SerializeToCsv(fields); Log(csv); Assert.That(csv, Is.EqualTo("1,2,\"3\"\"\",4,\"5\"\"five,six\"\"\",\"7,7.1\",\"\"\"7,7.1\"\"\",8\r\n")); }
public void Can_create_csv_from_Customers() { NorthwindData.LoadData(false); var csv = TypeSerializer.SerializeToCsv(NorthwindData.Customers); Log(csv); Assert.That(csv, Is.Not.Null); }
public void Can_create_csv_from_Categories() { NorthwindData.LoadData(false); var category = NorthwindFactory.Category(1, "between \"quotes\" here", "with, comma", null); var categories = new[] { category, category }; var csv = TypeSerializer.SerializeToCsv(categories); Log(csv); Assert.That(csv, Is.EqualTo("Id,CategoryName,Description,Picture\r\n1,\"between \"\"quotes\"\" here\",\"with, comma\",\r\n1,\"between \"\"quotes\"\" here\",\"with, comma\",\r\n")); }