Create method
Create an instance of a test fixture to run the named test.

Applies to
TTestCase

Declaration
Constructor Create(MethodName: string);

Description
Create a test fixture capabile of running a single testcase. The test case that will be run is the method called MethodName, which must be declared in the published section of a sub-class of TTestCase. see @TTestSuite see @ITestSuite

Implementation

constructor TTestCase.Create(MethodName: string);
var
  RunMethod: TMethod;
begin
  assert(length(MethodName) >0);
  assert(assigned(MethodAddress(MethodName)));

  inherited Create(MethodName);
  RunMethod.code := MethodAddress(MethodName);
  RunMethod.Data := self;
  fMethod := TTestMethod(RunMethod);

  assert(assigned(fMethod));
End;


HTML generated by Time2HELP
http://www.time2help.com