TesterViera / JavaLibTester

Java libraries for Test-First Design and interactive games for novices
7 stars 7 forks source link

boolean-valued Tester.run() methods #2

Open sbloch opened 11 years ago

sbloch commented 11 years ago

Changed the public "runWhatever" hooks in the Tester class to return true (if there were no errors) or false (if there was at least one), so "runWhatever" can be composed with other things. Such as, for example,

junit.framework.TestCase.assertTrue (Tester.run(new Whatever()));

so failed Tester cases show up as failed JUnit cases (in IDE's that support JUnit).

This should be backwards-compatible: any code that was calling Tester.run on the assumption that it returned void should still compile and run.

Alternatively, perhaps these should return an int (the number of errors encountered), which I guess would be even more informative.