Tag Archives: assert

Easily compare a list of Strings with the contents of a file

Context: you need to check that the values you have in a List of Strings are the same as the contents of a file. An element in the List will correspond to an entire line from the file. How can you achieve this easily? Continue reading Easily compare a list of Strings with the contents of a file

SoftAssert – don’t make your test fail on the first assertion failure

When you have more than one assertion in your test, you might want one of two things:

  1. Have your tests fail once the first assertion failure is encountered.
  2. Have all your assertions run, no matter if they have passed or failed. Of course, after they are run, if there are failures, you want the test to fail, and also show you where the issues were.

Continue reading SoftAssert – don’t make your test fail on the first assertion failure