|
|
@@ -78,6 +78,25 @@ public class FileConverterTest {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void textConvertDigitsOnly() throws IOException {
|
|
|
+ Path digitsFilePath = Paths.get("src/main/resources/digits.txt");
|
|
|
+ Files.writeString(digitsFilePath, "1234567890\n0987654321\n");
|
|
|
+
|
|
|
+ FileConverter converter = new FileConverter();
|
|
|
+ converter.convertToUpperCase(digitsFilePath.toString());
|
|
|
+
|
|
|
+ String actualContent = Files.readString(digitsFilePath);
|
|
|
+ actualContent = actualContent.replace("\r\n", "\n");
|
|
|
+ String expectedContent = "1234567890\n0987654321\n";
|
|
|
+
|
|
|
+ assertEquals(expectedContent, actualContent);
|
|
|
+ Files.deleteIfExists(digitsFilePath);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|