예제 #1
0
	// 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);
			}
예제 #2
0
	// 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);
			}
예제 #3
0
	// 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);
			}
예제 #4
0
	// 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);
				}
			}