JUnit test to check if a file has been created

I created a simple program that will create a dat file through a buffered writer and write some data to this file, and now please tell me what junit tests I can have, through which I can check whether the file is created or not c: drive I am using junit 3, please report.

+6
source share
1 answer
File file = new File("c:/pathOfTheCreatedFile"); assertTrue(file.exists()); // TODO: read the file. Check that it contains what it supposed to contain 
+23
source

Source: https://habr.com/ru/post/952340/


All Articles