diff options
author | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-06-26 21:01:16 +0200 |
---|---|---|
committer | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-06-26 21:01:16 +0200 |
commit | 8e72cabd763c8f6cfba63b9aaf9502ca15a3092f (patch) | |
tree | d361031a42d026d26ea42fb2d1dec62b719dccc9 /src/test/java/musichub/util | |
parent | 5dc7dea3ef53a385442c6bfd59054faa4b1d73d9 (diff) |
Moved PathValidation to the util package
Diffstat (limited to 'src/test/java/musichub/util')
-rw-r--r-- | src/test/java/musichub/util/PathValidationTest.java | 26 |
1 files changed, 26 insertions, 0 deletions
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()); + } + } +} |