As in title, let's say I have method which is saving file or throw new runtime exception. How can I write unit tests for it? What should be tested here?
Asked
Active
Viewed 172 times
1 Answers
0
You can create temporary folder using TemporaryFolder (as a JUnit rule, or as separate object) and save you file there. Then you can compare content of this file with the expected data of original file.
There was separate question about ways of compiring files.

y_ug
- 904
- 6
- 8