📄 testdialogunit.pas
字号:
{-----------------------------------------------------------------------------
Unit Name: TestDialogUnit
Author: hubdog(陈省)
Email: hubdog@263.net
Purpose:
History:
2003-4-7 创建本单元
-----------------------------------------------------------------------------}
unit TestDialogUnit;
interface
uses
TestFrameWork, TestForm, Forms, Windows, Controls, GUITesting;
type
TDialogTestCase = class(TGUITestCase)
private
FDialog:TFormTest;
protected
procedure SetUp; override;
procedure TearDown; override;
published
procedure TestTabOrder;
procedure TestKey;
end;
implementation
{ TDialogTestCase }
procedure TDialogTestCase.SetUp;
begin
inherited;
FDialog:=TFormTest.Create(nil);
GUI:=FDialog;
FDialog.Show;
//FDialog.ShowModal;
end;
procedure TDialogTestCase.TearDown;
begin
GUI:=nil;
FDialog.Free;
inherited;
// FDialog.ModalResult:=mrOK;
end;
procedure TDialogTestCase.TestKey;
begin
FDialog.Edit1.SetFocus;
Self.EnterKey(VK_RETURN);
Check(FDialog.Visible=false, 'Form Closed?')
end;
procedure TDialogTestCase.TestTabOrder;
begin
CheckFocused('Edit1');
Tab;
CheckFocused('Edit2');
Tab;
CheckFocused('Button1');
Tab;
CheckFocused('Button2');
end;
initialization
TestFramework.RegisterTest('TestDialogUnit Suite',
TDialogTestCase.Suite);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -