|
|
@@ -9,7 +9,7 @@ import java.nio.file.Paths;
|
|
|
public class FileConverterTest {
|
|
|
|
|
|
@Test
|
|
|
- public void testConvertToUpperCase() throws IOException {
|
|
|
+ void testConvertToUpperCase() throws IOException {
|
|
|
Path filePath = Paths.get("src/main/resources/test.txt");
|
|
|
String originalContent = Files.readString(filePath);
|
|
|
String expectedContent ="TEST\n" +
|
|
|
@@ -29,4 +29,28 @@ public class FileConverterTest {
|
|
|
|
|
|
// Files.writeString(filePath, originalContent);
|
|
|
}
|
|
|
+
|
|
|
+ // test na pusty plik
|
|
|
+ @Test
|
|
|
+ void testConvertEmpty() throws IOException{
|
|
|
+ Path emptyFilePath = Paths.get("src/main/resources/empty.txt");
|
|
|
+ //Files.createFile(emptyFilePath); // twrorzy plik
|
|
|
+
|
|
|
+ FileConverter converter = new FileConverter();
|
|
|
+ converter.convertToUpperCase(emptyFilePath.toString());
|
|
|
+
|
|
|
+ String actualContent = Files.readString(emptyFilePath);
|
|
|
+
|
|
|
+ assertEquals("",actualContent);
|
|
|
+
|
|
|
+ //Files.deleteIfExists(emptyFilePath); // usuwa plik
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|