From 14cc2f02f58e200949ea70d06dc198be3092afb0 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Tue, 2 May 2023 10:50:01 +0200 Subject: Add unit tests --- .../java/it/alessandroiezzi/csv/CSVUtilsTest.java | 34 ++++++++++++++++++++++ src/test/resources/test.csv | 4 +++ 2 files changed, 38 insertions(+) create mode 100644 src/test/java/it/alessandroiezzi/csv/CSVUtilsTest.java create mode 100644 src/test/resources/test.csv diff --git a/src/test/java/it/alessandroiezzi/csv/CSVUtilsTest.java b/src/test/java/it/alessandroiezzi/csv/CSVUtilsTest.java new file mode 100644 index 0000000..2a15757 --- /dev/null +++ b/src/test/java/it/alessandroiezzi/csv/CSVUtilsTest.java @@ -0,0 +1,34 @@ +/* + * A simple CSV utility + * Copyright (C) 2022 Alessandro Iezzi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package it.alessandroiezzi.csv; + +import org.junit.Test; + +import java.io.File; +import java.io.IOException; + +import static org.junit.Assert.*; + +public class CSVUtilsTest { + @Test + public void test_parseCSV() throws IOException { + CSVUtils csvUtils = new CSVUtils(getClass().getClassLoader().getResourceAsStream("test.csv")); + csvUtils.parse(); + } +} diff --git a/src/test/resources/test.csv b/src/test/resources/test.csv new file mode 100644 index 0000000..74999ac --- /dev/null +++ b/src/test/resources/test.csv @@ -0,0 +1,4 @@ +codice;tag;blacklist +999xx;;S +888xx;Ale; +7t7t7t7;;S \ No newline at end of file -- cgit v1.2.3