|
@@ -94,6 +94,22 @@ public class FileConverterTest {
|
|
|
Files.deleteIfExists(digitsFilePath);
|
|
Files.deleteIfExists(digitsFilePath);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
|
+ void textConvertSpecialCharacters() throws IOException {
|
|
|
|
|
+ Path specialCharactersFilePath = Paths.get("src/main/resources/specialChars.txt");
|
|
|
|
|
+ Files.writeString(specialCharactersFilePath, "@#$%^&*()_+[]{}|;:',.<>/?-=~`");
|
|
|
|
|
+
|
|
|
|
|
+ FileConverter converter = new FileConverter();
|
|
|
|
|
+ converter.convertToUpperCase(specialCharactersFilePath.toString());
|
|
|
|
|
+
|
|
|
|
|
+ String actualContent = Files.readString(specialCharactersFilePath);
|
|
|
|
|
+ actualContent = actualContent.replace("\r\n", "\n");
|
|
|
|
|
+ String expectedContent = "@#$%^&*()_+[]{}|;:',.<>/?-=~`\n";
|
|
|
|
|
+
|
|
|
|
|
+ assertEquals(expectedContent, actualContent);
|
|
|
|
|
+ Files.deleteIfExists(specialCharactersFilePath);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|