From 47986b4bc07466d748732a8eed93befb09ddf642 Mon Sep 17 00:00:00 2001 From: "Begerad, Stefan" Date: Sun, 8 Aug 2021 02:09:47 -0400 Subject: [PATCH] feat(file-cleaner): added unit tests --- .../de/begerad/fileagerm/TestFileCleaner.java | 4 ++++ .../begerad/fileagerm/TestFileExplorer.java | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 file-cleaner/src/test/java/de/begerad/fileagerm/TestFileCleaner.java create mode 100644 file-cleaner/src/test/java/de/begerad/fileagerm/TestFileExplorer.java diff --git a/file-cleaner/src/test/java/de/begerad/fileagerm/TestFileCleaner.java b/file-cleaner/src/test/java/de/begerad/fileagerm/TestFileCleaner.java new file mode 100644 index 0000000..ce604b5 --- /dev/null +++ b/file-cleaner/src/test/java/de/begerad/fileagerm/TestFileCleaner.java @@ -0,0 +1,4 @@ +package de.begerad.fileagerm; + +public class TestFileCleaner { +} diff --git a/file-cleaner/src/test/java/de/begerad/fileagerm/TestFileExplorer.java b/file-cleaner/src/test/java/de/begerad/fileagerm/TestFileExplorer.java new file mode 100644 index 0000000..32cd5e9 --- /dev/null +++ b/file-cleaner/src/test/java/de/begerad/fileagerm/TestFileExplorer.java @@ -0,0 +1,21 @@ +package de.begerad.fileagerm; + +import org.junit.jupiter.api.Test; + +import java.io.File; + +import static org.junit.jupiter.api.Assertions.*; + +public class TestFileExplorer { + + @Test + public void testEmptyListFiles() { + File[] files = FileExplorer.listFiles("/mnt"); + assertTrue(files.length == 0); + } + + @Test + public void testNullListFiles() { + assertNull(FileExplorer.listFiles("/etc/hosts")); + } +}