Răsfoiți Sursa

Stworzono test dla pustego pliku weryfikacji zachowań dla DirConverter

Adam Matuszewski 1 an în urmă
părinte
comite
6d2fcda773

+ 10 - 0
KonwersjaLiter2/src/test/java/pl/dmcs/DirConverterBehaviorTest.java

@@ -47,4 +47,14 @@ public class DirConverterBehaviorTest {
         verify(fileConverter).convertToUpperCase(Paths.get(TEST_DIR, "file3.txt").toString());
     }
 
+    @Test
+    void testConvertDirEmptyFile() throws IOException {
+        Path emptyFilePath = Paths.get(TEST_DIR, "empty.txt");
+        Files.write(emptyFilePath, new byte[0]);
+
+        dirConverter.convertDir(TEST_DIR, FILE_EXTENSION);
+
+        verify(fileConverter).convertToUpperCase(emptyFilePath.toString());
+    }
+
 }