Skip to content

Commit

Permalink
TODO test
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr committed Aug 11, 2022
1 parent 4247771 commit 7495c48
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/test/java/org/jabref/model/util/FileHelperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import java.util.Optional;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import static org.junit.jupiter.api.Assertions.assertEquals;

class FileHelperTest {

@Test
public void extractFileExtension() {
final String filePath = FileHelperTest.class.getResource("pdffile.pdf").getPath();
Expand All @@ -24,14 +26,19 @@ public void fileExtensionFromUrl() {

@Test
public void testFileNameEmpty() {
Path path = Path.of("/");
assertEquals(Optional.of(path), FileHelper.find("", path));
Path path = Path.of("/");
assertEquals(Optional.of(path), FileHelper.find("", path));
}

@ParameterizedTest
@ValueSource(strings = { "*", "?", ">", "\"" })
@ValueSource(strings = {"*", "?", ">", "\""})
public void testFileNameIllegal(String fileName) {
Path path = Path.of("/");
assertEquals(Optional.empty(), FileHelper.find(fileName, path));
}

@Test
public void testPathWithSubDirectories(@TempDir Path temp) throws Exception {
// TODO
}
}

0 comments on commit 7495c48

Please sign in to comment.