From 16dc92f970360e918814f61747329ab5de38898c Mon Sep 17 00:00:00 2001 From: Esoteric Enderman Date: Tue, 29 Oct 2024 17:49:42 +0000 Subject: [PATCH] Add subfolder to test that --- .../plugins/library/file/FileManagerTest.kt | 15 ++++++++++++++- .../FileManagerTest/1/Subfolder/Test File 3.txt | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 lib/src/test/resources/file/FileManagerTest/1/Subfolder/Test File 3.txt diff --git a/lib/src/test/kotlin/foundation/esoteric/minecraft/plugins/library/file/FileManagerTest.kt b/lib/src/test/kotlin/foundation/esoteric/minecraft/plugins/library/file/FileManagerTest.kt index 0650bcc..317997b 100644 --- a/lib/src/test/kotlin/foundation/esoteric/minecraft/plugins/library/file/FileManagerTest.kt +++ b/lib/src/test/kotlin/foundation/esoteric/minecraft/plugins/library/file/FileManagerTest.kt @@ -26,6 +26,10 @@ class FileManagerTest { val testFileOne = File(testOneDir, "Test File 1.txt") val testFileTwo = File(testOneDir, "Test File 2.txt") + val subFolder = File(testOneDir, "Subfolder") + + val testFileThree = File(subFolder, "Test File 3.txt") + assertTrue(fileDir.exists()) assertTrue(fileDir.isDirectory) assertNotNull(fileDir.listFiles()) @@ -39,7 +43,7 @@ class FileManagerTest { assertTrue(testOneDir.exists()) assertTrue(testOneDir.isDirectory) assertNotNull(testOneDir.listFiles()) - assertEquals(testOneDir.listFiles()!!.size, 2) + assertEquals(testOneDir.listFiles()!!.size, 3) assertTrue(testFileOne.exists()) assertFalse(testFileOne.isDirectory) @@ -48,5 +52,14 @@ class FileManagerTest { assertTrue(testFileTwo.exists()) assertFalse(testFileTwo.isDirectory) assertEquals(testFileTwo.readText(), "This file is used to test the FileManager.\r\n") + + assertTrue(subFolder.exists()) + assertTrue(subFolder.isDirectory) + assertNotNull(subFolder.listFiles()) + assertEquals(subFolder.listFiles()!!.size, 1) + + assertTrue(testFileThree.exists()) + assertFalse(testFileThree.isDirectory) + assertEquals(testFileThree.readText(), "A third test file for the FileManagerTest.\r\n") } } diff --git a/lib/src/test/resources/file/FileManagerTest/1/Subfolder/Test File 3.txt b/lib/src/test/resources/file/FileManagerTest/1/Subfolder/Test File 3.txt new file mode 100644 index 0000000..82509ee --- /dev/null +++ b/lib/src/test/resources/file/FileManagerTest/1/Subfolder/Test File 3.txt @@ -0,0 +1 @@ +A third test file for the FileManagerTest.