Unit2Test.pas
上传用户:yjb1804
上传日期:2021-01-30
资源大小:3105k
文件大小:1k
源码类别:

Email服务器

开发平台:

Delphi

  1. unit Unit2Test;
  2. interface
  3. uses
  4.   TestFramework, Unit2;
  5. type
  6.   TTestSuperObject = class(TTestCase)
  7.   private
  8.     FSuperObject: TSuperObject;
  9.   public
  10.     procedure Setup; override;
  11.     procedure TearDown; override;
  12.   published
  13.     procedure testSuperObject;
  14.   end;
  15.   function Suite: ITestSuite;
  16. implementation
  17. function Suite: ITestSuite;
  18. begin
  19.   Result := TTestSuite.Create(TTestSuperObject);
  20. end;
  21. { TTestSuperObject }
  22. procedure TTestSuperObject.Setup;
  23. begin
  24.   FSuperObject := TSuperObject.Create;
  25. end;
  26. procedure TTestSuperObject.TearDown;
  27. begin
  28.   FSuperObject.Free;
  29. end;
  30. procedure TTestSuperObject.testSuperObject;
  31. begin
  32.   assert(FSuperObject.DoSomethingSuper);
  33. end;
  34. end.