123456789101112131415161718192021222324252627 |
- class Tester {
- private int testsPassed = 0;
- private int testsTotal = 0;
-
- public void pass(String desc) {
- System.out.println("PASSED: "+desc);
- testsPassed += 1;
- testsTotal += 1;
- }
-
- public void fail(String desc) {
- System.out.println("FAILED: "+desc);
- testsTotal += 1;
- }
-
- public void testStr(String actual, String expected, String desc) {
- if (expected.equals(actual)) {
- pass(desc);
- } else {
- fail(desc);
- }
- }
-
- public void printResult() {
- System.out.println(testsPassed+"/"+testsTotal+" tests passed.");
- }
- }
|