University stuff.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627
  1. class Tester {
  2. private int testsPassed = 0;
  3. private int testsTotal = 0;
  4. public void pass(String desc) {
  5. System.out.println("PASSED: "+desc);
  6. testsPassed += 1;
  7. testsTotal += 1;
  8. }
  9. public void fail(String desc) {
  10. System.out.println("FAILED: "+desc);
  11. testsTotal += 1;
  12. }
  13. public void testStr(String actual, String expected, String desc) {
  14. if (expected.equals(actual)) {
  15. pass(desc);
  16. } else {
  17. fail(desc);
  18. }
  19. }
  20. public void printResult() {
  21. System.out.println(testsPassed+"/"+testsTotal+" tests passed.");
  22. }
  23. }