diff options
author | Clyhtsuriva <61652557+clyhtsuriva@users.noreply.github.com> | 2021-06-27 11:02:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-27 11:02:03 +0000 |
commit | e13eea333d7af2786dbbbb5ed60cea4593d5ee12 (patch) | |
tree | d87270f2e9cee0586a3c7b49033cefaca0c107d0 /src/test/java/musichub/util/PathValidationTest.java | |
parent | 18359e9e2892a332f283476bc3ae887308f51cec (diff) | |
parent | 9a234079437a1532072ed5f0bce0203922719b0f (diff) |
Merge pull request #10 from Said-Belhadj/feature/STZ-0012
Feature/stz 0012
Diffstat (limited to 'src/test/java/musichub/util/PathValidationTest.java')
-rw-r--r-- | src/test/java/musichub/util/PathValidationTest.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/java/musichub/util/PathValidationTest.java b/src/test/java/musichub/util/PathValidationTest.java index 4c7a3d6..b0e0c38 100644 --- a/src/test/java/musichub/util/PathValidationTest.java +++ b/src/test/java/musichub/util/PathValidationTest.java @@ -8,19 +8,19 @@ 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()); + } catch (Error e) { + assertTrue(e instanceof AssertionError); + assertEquals("You just can't instantiate this class.", e.getMessage()); } } + + @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 + } } |