// Run the test case, and pass its results to a given object. // This also implements the "Test" interface. public void Run(TestResult result) { result.StartTest(this, false); Setup(); try { RunTest(); } catch(TestAssertFailed assert) { result.AddFailure(this, assert); } catch(TestStop) { // Something wants us to stop testing immediately. throw; } catch(Exception e) { result.AddException(this, e); } finally { Cleanup(); } result.EndTest(this, false); }
// Implement the "Test" interface. public void Run(TestResult result) { int posn; result.StartTest(this, true); for(posn = 0; posn < tests.Length; ++posn) { ((Test)(tests[posn])).Run(result); } result.EndTest(this, true); }
// List the tests to a TestResult object, but don't run them. // Implements the "Test" interface. public void List(TestResult result) { result.ListTest(this, false); }
// List the tests to a TestResult object, but don't run them. // Implements the "Test" interface. public void List(TestResult result) { int posn; result.ListTest(this, true); for(posn = 0; posn < tests.Length; ++posn) { ((Test)(tests[posn])).List(result); } }