diff options
author | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-06-27 13:24:40 +0200 |
---|---|---|
committer | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-06-27 13:24:40 +0200 |
commit | f5117515ab26658e93d9efc2d99651c332840782 (patch) | |
tree | 9695b8cbd65fa1e914b30597b64c79e484cacdcd /src/test/java/musichub | |
parent | e13eea333d7af2786dbbbb5ed60cea4593d5ee12 (diff) |
Added an extension check for songs and covered it with a test.
Diffstat (limited to 'src/test/java/musichub')
-rw-r--r-- | src/test/java/musichub/util/PathValidationTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/java/musichub/util/PathValidationTest.java b/src/test/java/musichub/util/PathValidationTest.java index b0e0c38..f087ac1 100644 --- a/src/test/java/musichub/util/PathValidationTest.java +++ b/src/test/java/musichub/util/PathValidationTest.java @@ -19,8 +19,9 @@ 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 + assertTrue(isPathValid("Song/Side_To_Side.wav")); //right path, right file, right extension + assertFalse(isPathValid("wrong_path/Side_To_Side.wav")); //wrong path, right file, right extension + assertFalse(isPathValid("Song/Side_To_Side.mp3")); //right path, right file, wrong extension + assertFalse(isPathValid("Song/Side_To_Sidewav")); //right path, right file, wrong extension (without a dot) } } |