Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. @Rule
  2. public TemporaryFolder tempFolder = new TemporaryFolder();
  3.  
  4. @Before
  5. public void setup() {
  6. }
  7.  
  8. @Test
  9. public void getContentFile() throws IOException {
  10. File textFile = tempFolder.newFile("testText.txt");
  11. String pathFile = textFile.getPath();
  12. FileWriter fileWriter = new FileWriter(textFile.getName());
  13. fileWriter.write("Line1 a");
  14. fileWriter.write("Line2 b c");
  15. fileWriter.write("Line3 3");
  16. String[] testedContent = contentFileRetriever.getContentFile(pathFile);
  17. String[] expected = {"Line1 a", "Line2 b c", "Line 3"};
  18. assertArrayEquals(expected, testedContent);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement