-1

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?

Kerdac
  • 47
  • 3
  • Please provide us with your work you did so far. We can only help if we get some more informations. – Melvin Mar 18 '20 at 11:58

1 Answers1

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