Unit1Test.pas
上传用户:yjb1804
上传日期:2021-01-30
资源大小:3105k
文件大小:1k
- unit Unit1Test;
- interface
- uses
- TestFramework, Unit1;
- type
- TTestMyObject = class(TTestCase)
- private
- FMyObject: TMyObject;
- public
- procedure Setup; override;
- procedure TearDown; override;
- published
- procedure testMyObject;
- end;
- implementation
- { TTestMyObject }
- procedure TTestMyObject.Setup;
- begin
- FMyObject := TMyObject.Create;
- end;
- procedure TTestMyObject.TearDown;
- begin
- FMyObject.Free;
- end;
- procedure TTestMyObject.testMyObject;
- begin
- try
- FMyObject.DoSomething;
- except
- check(false);
- end;
- end;
- initialization
- RegisterTest('', TTestMyObject.Suite);
- end.