package pl.dmcs; import org.testng.annotations.Test; import static org.junit.jupiter.api.Assertions.*; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class FileConverterTest { @Test public void testConvertToUpperCase() throws IOException { Path filePath = Paths.get("src/main/resources/test.txt"); String originalContent = Files.readString(filePath); String expectedContent ="TEST\n" + "PRZYKLADOWY TEKST MALYMI LITERAMI\n" + "12345\n" + "ABCDEF\n"; FileConverter converter = new FileConverter(); converter.convertToUpperCase(filePath.toString()); String actualContent = Files.readString(filePath); expectedContent = expectedContent.replace("\r\n", "\n"); actualContent = actualContent.replace("\r\n", "\n"); assertEquals(expectedContent, actualContent); // Files.writeString(filePath, originalContent); } }