CSVExporter: add test case for quoteAll option (#2430)

This commit is contained in:
Albin Larsson 2020-03-18 05:39:32 +01:00 committed by GitHub
parent 4ba75034cb
commit 0233e7186b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,6 @@ public class CsvExporterTests extends RefineTest {
Assert.assertEquals(writer.toString(), "column0,column1\n" +
"row0cell0,row0cell1\n" +
"row1cell0,row1cell1\n");
}
@Test
@ -124,7 +123,7 @@ public class CsvExporterTests extends RefineTest {
verify(options,times(2)).getProperty("printColumnHeader");
}
@Test
public void exportSimpleCsvCustomLineSeparator(){
CreateGrid(2, 2);
@ -139,7 +138,22 @@ public class CsvExporterTests extends RefineTest {
Assert.assertEquals(writer.toString(), "column0,column1X" +
"row0cell0,row0cell1X" +
"row1cell0,row1cell1X");
}
@Test
public void exportSimpleCsvQuoteAll(){
CreateGrid(2, 2);
when(options.getProperty("options")).thenReturn("{\"quoteAll\":\"true\"}");
try {
SUT.export(project, options, engine, writer);
} catch (IOException e) {
Assert.fail();
}
Assert.assertEquals(writer.toString(), "\"column0\",\"column1\"\n" +
"\"row0cell0\",\"row0cell1\"\n" +
"\"row1cell0\",\"row1cell1\"\n");
}
@Test