unit FormTest;

interface

uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, FormEx,
  TestCase;

type

  { TFormTest }

  TFormTest = class(TFormEx)
    ButtonRun: TButton;
    ButtonClose: TButton;
    MemoLog: TMemo;
    procedure FormShow(Sender: TObject);
    procedure ButtonRunClick(Sender: TObject);
  private
    FTestCase: TTestCase;
    procedure SetTestCase(AValue: TTestCase);
  public
    property TestCase: TTestCase read FTestCase write SetTestCase;
  end;


implementation

{$R *.lfm}

{ TFormTest }

procedure TFormTest.FormShow(Sender: TObject);
begin
  if Assigned(FTestCase) then MemoLog.Text := FTestCase.Log;
end;

procedure TFormTest.SetTestCase(AValue: TTestCase);
begin
  if FTestCase = AValue then Exit;
  FTestCase := AValue;
end;

procedure TFormTest.ButtonRunClick(Sender: TObject);
begin
  if Assigned(FTestCase) then begin
    FTestCase.Run;
    MemoLog.Text := FTestCase.Log;
  end;
end;

end.

