Вот это:
-- это - "ужас.. ужас..."
Почему? Надеюсь - объяснять не нужно.
P.S. вообще говоря, DUnit это - "КРУТАЯ ТЕМА". С ХОРОШИМ функционалом. А "внутри" - "ужас.. ужас...". Хотя наверное авторы и не стремились к "правильной и расширяемой архитектуре".
Что ещё раз доказывает тот факт, что "какие бы ни бы ли КРУТЫЕ и ПРАВИЛЬНЫЕ программисты - стоит им немного "ослабить контроль над собой" и получается "говно-код"".
За собой не раз это замечал... Хотя к КРУТЫМ и ПРАВИЛЬНЫМ я себя конечно же - НЕ ОТНОШУ...
  ITest = interface(IUnknown)
    ['{89CCD557-7DE1-4814-B033-ABAFE0870EC7}']
    function GetName: string;
    function  CountTestCases: integer;
    function  CountEnabledTestCases: integer;
    function  Tests: IInterfaceList;
    procedure SetUp;
    procedure TearDown;
    function  Run : TTestResult;  overload;
    procedure Run(testResult: TTestResult); overload;
    procedure RunWithFixture(testResult: TTestResult);
    procedure RunTest(testResult: TTestResult);
    function  GetTestMethodInvoked: Boolean;
    procedure SetTestMethodInvoked(const Value: Boolean);
    property  TestMethodInvoked: Boolean read  GetTestMethodInvoked
                                         write SetTestMethodInvoked;
    function  GetEnabled: Boolean;
    procedure SetEnabled(Value: Boolean);
    procedure SetStartTime(Value :Int64);
    function  GetStartTime : Int64;
    procedure SetStopTime(Value :Int64);
    function  GetStopTime : Int64;
    function  ElapsedTestTime: Cardinal;
    function  GetRunCount: integer;
    procedure SetRunCount(Value: Integer);
    procedure SetStatusListener(Listener :IStatusListener);
    function  GetStatus :string;
    procedure LoadConfiguration(const iniFile :TCustomIniFile; const section :string);  overload;
    procedure LoadConfiguration(const fileName: string; const useRegistry, useMemIni: Boolean); overload;
    procedure SaveConfiguration(const iniFile :TCustomIniFile; const section :string);  overload;
    procedure SaveConfiguration(const fileName: string; const useRegistry, useMemIni: Boolean); overload;
    procedure SetGUIObject(const guiObject: TObject);
    function  GetGUIObject: TObject;
    property RunCount: Integer read GetRunCount write SetRunCount;
    property Name:    string  read GetName;
    property Enabled: Boolean read GetEnabled write SetEnabled;
    property GUIObject: TObject read GetGUIObject write SetGUIObject;
    property Status:  string  read GetStatus;
    property StartTime: Int64 read GetStartTime write SetStartTime;
    property StopTime:  Int64 read GetStopTime  write SetStopTime;
    procedure SetFailsOnNoChecksExecuted(const Value: Boolean);
    function  GetFailsOnNoChecksExecuted: Boolean;
    property  FailsOnNoChecksExecuted: Boolean
                read GetFailsOnNoChecksExecuted
                write SetFailsOnNoChecksExecuted;
    function  GetFailsOnMemoryLeak: Boolean;
    procedure SetFailsOnMemoryLeak(const Value: Boolean);
    property  FailsOnMemoryLeak: Boolean
                read GetFailsOnMemoryLeak
                write SetFailsOnMemoryLeak;
    function  GetAllowedMemoryLeakSize: Integer;
    procedure SetAllowedMemoryLeakSize(const NewSize: Integer);
    property  AllowedMemoryLeakSize: Integer read GetAllowedMemoryLeakSize
                                           write SetAllowedMemoryLeakSize;
    function  GetFailsOnMemoryRecovery: Boolean;
    procedure SetFailsOnMemoryRecovery(const Value: Boolean);
    property  FailsOnMemoryRecovery: Boolean
                read GetFailsOnMemoryRecovery
                write SetFailsOnMemoryRecovery;
    procedure SetAllowedLeakArray(AllowedList: array of Integer);
    function  GetIgnoreSetUpTearDownLeaks: Boolean;
    procedure SetIgnoreSetUpTearDownLeaks(const Value: Boolean);
    property  IgnoreSetUpTearDownLeaks: Boolean
                read GetIgnoreSetUpTearDownLeaks
                write SetIgnoreSetUpTearDownLeaks;
    function  GetAllowedLeak: Integer;
    function  GetAllowedLeaksIterator: TListIterator;
    property  AllowedLeaksIterator: TListIterator read GetAllowedLeaksIterator;
  end;
-- это - "ужас.. ужас..."
Почему? Надеюсь - объяснять не нужно.
P.S. вообще говоря, DUnit это - "КРУТАЯ ТЕМА". С ХОРОШИМ функционалом. А "внутри" - "ужас.. ужас...". Хотя наверное авторы и не стремились к "правильной и расширяемой архитектуре".
Что ещё раз доказывает тот факт, что "какие бы ни бы ли КРУТЫЕ и ПРАВИЛЬНЫЕ программисты - стоит им немного "ослабить контроль над собой" и получается "говно-код"".
За собой не раз это замечал... Хотя к КРУТЫМ и ПРАВИЛЬНЫМ я себя конечно же - НЕ ОТНОШУ...
Правда есть "реализация" - TTestSuite. Которая конечно "снимает часть вопросов".
ОтветитьУдалить