From 2c28e9758ae04493dd803111818496c8eedf5720 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Mon, 4 Jun 2018 09:15:50 +0200 Subject: [PATCH] Moved unitary tests. --- test/fr/devinsy/strings/StringsUtilsTest.java | 18 ++++++++++++++++++ test/fr/devinsy/strings/lines.txt | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 test/fr/devinsy/strings/lines.txt diff --git a/test/fr/devinsy/strings/StringsUtilsTest.java b/test/fr/devinsy/strings/StringsUtilsTest.java index 107d62c..d643166 100644 --- a/test/fr/devinsy/strings/StringsUtilsTest.java +++ b/test/fr/devinsy/strings/StringsUtilsTest.java @@ -18,6 +18,7 @@ */ package fr.devinsy.strings; +import java.io.IOException; import java.util.ArrayList; import java.util.Collection; @@ -224,4 +225,21 @@ public class StringsUtilsTest source.set(1, null); Assert.assertTrue(StringsUtils.containsNull(source)); } + + /** + * Load to string list URL 01. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void testLoadResource01() throws IOException + { + // + StringList source = StringsUtils.load(StringsUtilsTest.class.getResource("/fr/devinsy/strings/lines.txt")); + + // + Assert.assertEquals(4, source.size()); + Assert.assertEquals("trois", source.get(3 - 1)); + } } diff --git a/test/fr/devinsy/strings/lines.txt b/test/fr/devinsy/strings/lines.txt new file mode 100644 index 0000000..de1c537 --- /dev/null +++ b/test/fr/devinsy/strings/lines.txt @@ -0,0 +1,4 @@ +un +deux +trois +quatre \ No newline at end of file