Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • When you do that you you should better using testing frameworks with dependant tests, it is better (e.g. testng supports this feature) Commented Oct 26, 2012 at 13:44
  • 10
    I write tests like this too so that you can be confident of what the code is doing and state changes, I don't think this is a unit test, but an integration test. Commented Sep 11, 2013 at 9:30
  • What are your opinions about refactoring it into a assertAlarmStatus( int numberOfAlarmMessages);? Commented Mar 7, 2016 at 16:37
  • 2
    Your asserts would make for very nice test names. Commented Oct 21, 2016 at 18:38
  • It's better to let the test run, even on invalid input. It gives you more information that way (and especially if it still passes when you didn't expect it to). Commented Apr 19, 2018 at 4:47