File tree 1 file changed +18
-0
lines changed
src/test/java/org/spacious_team/table_wrapper/csv
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 29
29
import java .io .IOException ;
30
30
import java .io .InputStream ;
31
31
import java .nio .charset .Charset ;
32
+ import java .nio .file .Files ;
33
+ import java .nio .file .Path ;
32
34
33
35
import static org .junit .jupiter .api .Assertions .assertEquals ;
34
36
import static org .junit .jupiter .api .Assertions .assertNull ;
35
37
36
38
class CsvReportPageTest {
37
39
40
+ @ Test
41
+ @ SuppressWarnings ("ConstantConditions" )
42
+ void createFromFile () throws IOException {
43
+ Path path = Files .createTempFile ("table-wrapper-csv-impl-test.csv" , "csv" );
44
+ try {
45
+ Files .writeString (path , "0,1" );
46
+ CsvReportPage reportPage = new CsvReportPage (path );
47
+
48
+ @ Nullable CsvTableRow row = reportPage .getRow (0 );
49
+ assertEquals ("0" , row .getCell (0 ).getValue ());
50
+ assertEquals ("1" , row .getCell (1 ).getValue ());
51
+ } finally {
52
+ Files .delete (path );
53
+ }
54
+ }
55
+
38
56
@ ParameterizedTest
39
57
@ ValueSource (strings = {"UTF-8" , "Windows-1251" })
40
58
void testInputDataCharset (String charsetName ) throws IOException {
You can’t perform that action at this time.
0 commit comments