From 8e72cabd763c8f6cfba63b9aaf9502ca15a3092f Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Sat, 26 Jun 2021 21:01:16 +0200 Subject: Moved PathValidation to the util package --- .../java/musichub/business/PathValidationTest.java | 26 ---------------------- .../java/musichub/util/PathValidationTest.java | 26 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 src/test/java/musichub/business/PathValidationTest.java create mode 100644 src/test/java/musichub/util/PathValidationTest.java (limited to 'src/test/java') diff --git a/src/test/java/musichub/business/PathValidationTest.java b/src/test/java/musichub/business/PathValidationTest.java deleted file mode 100644 index fffbdde..0000000 --- a/src/test/java/musichub/business/PathValidationTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package musichub.business; - - -import org.junit.jupiter.api.Test; - -import static musichub.business.PathValidation.isPathValid; -import static org.junit.jupiter.api.Assertions.*; - -public class PathValidationTest { - @Test - void testIsPathValid() { - assertTrue(isPathValid("Song/Side_To_Side.wav")); //the right path - assertFalse(isPathValid("wrong_path/Side_To_Side.wav")); //wrong path - assertFalse(isPathValid("Song/Side_To_Side.mp3")); //wrong extension - } - - @Test - void testPathValidationClass() { - try { - PathValidation pathValidationClass = new PathValidation(); - } catch (Error ex) { - assertTrue(ex instanceof AssertionError); - assertEquals("You just can't instantiate this class.", ex.getMessage()); - } - } -} diff --git a/src/test/java/musichub/util/PathValidationTest.java b/src/test/java/musichub/util/PathValidationTest.java new file mode 100644 index 0000000..4c7a3d6 --- /dev/null +++ b/src/test/java/musichub/util/PathValidationTest.java @@ -0,0 +1,26 @@ +package musichub.util; + + +import org.junit.jupiter.api.Test; + +import static musichub.util.PathValidation.isPathValid; +import static org.junit.jupiter.api.Assertions.*; + +public class PathValidationTest { + @Test + void testIsPathValid() { + assertTrue(isPathValid("Song/Side_To_Side.wav")); //the right path + assertFalse(isPathValid("wrong_path/Side_To_Side.wav")); //wrong path + assertFalse(isPathValid("Song/Side_To_Side.mp3")); //wrong extension + } + + @Test + void testPathValidationClass() { + try { + PathValidation pathValidationClass = new PathValidation(); + } catch (Error ex) { + assertTrue(ex instanceof AssertionError); + assertEquals("You just can't instantiate this class.", ex.getMessage()); + } + } +} -- cgit v1.2.3