- Timestamp:
- Aug 30, 2022, 7:56:17 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormTest.lfm
r127 r146 10 10 OnClose = FormClose 11 11 OnCreate = FormCreate 12 OnDestroy = FormDestroy13 12 OnShow = FormShow 14 LCLVersion = '2.2. 0.4'13 LCLVersion = '2.2.2.0' 15 14 object ListViewTestCases: TListView 16 15 Left = 19 … … 55 54 Anchors = [akLeft, akBottom] 56 55 Caption = ' ' 56 ParentColor = False 57 57 end 58 58 object ActionList1: TActionList -
trunk/Forms/UFormTest.pas
r129 r146 5 5 uses 6 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls, 7 ActnList, Menus, UTest ;7 ActnList, Menus, UTest, UTestCase; 8 8 9 9 type … … 26 26 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 27 27 procedure FormCreate(Sender: TObject); 28 procedure FormDestroy(Sender: TObject);29 28 procedure FormShow(Sender: TObject); 30 29 procedure ListViewTestCasesData(Sender: TObject; Item: TListItem); … … 59 58 Item.Caption := Name; 60 59 Item.Data := TestCases[Item.Index]; 61 Item.SubItems.Add(ResultText[ Result]);60 Item.SubItems.Add(ResultText[TestResult]); 62 61 end; 63 62 end; … … 97 96 Failed := 0; 98 97 for I := 0 to TestCases.Count - 1 do begin 99 case TestCases[I]. Result of98 case TestCases[I].TestResult of 100 99 trPassed: Inc(Passed); 101 100 trFailed: Inc(Failed); … … 148 147 end; 149 148 150 procedure TFormTest.FormDestroy(Sender: TObject);151 begin152 end;153 154 149 procedure TFormTest.FormShow(Sender: TObject); 155 150 begin -
trunk/Languages/vCardStudio.cs.po
r142 r146 1260 1260 msgstr "Očekáváno:" 1261 1261 1262 #: utest.sfailed1263 msgctxt "utest.sfailed"1264 msgid "Failed"1265 msgstr "Selhalo"1266 1267 #: utest.snone1268 msgid "None"1269 msgstr "Žádný"1270 1271 1262 #: utest.soutput 1272 1263 msgid "Output:" 1273 1264 msgstr "Výstup:" 1274 1275 #: utest.spassed1276 msgctxt "utest.spassed"1277 msgid "Passed"1278 msgstr "Prošlo"1279 1265 1280 1266 #: uvcardfile.svcardfile … … 1282 1268 msgid "vCard file" 1283 1269 msgstr "Soubor vCard" 1270 -
trunk/Languages/vCardStudio.pot
r138 r146 1233 1233 msgstr "" 1234 1234 1235 #: utest.sfailed1236 msgctxt "utest.sfailed"1237 msgid "Failed"1238 msgstr ""1239 1240 #: utest.snone1241 msgid "None"1242 msgstr ""1243 1244 1235 #: utest.soutput 1245 1236 msgid "Output:" 1246 msgstr ""1247 1248 #: utest.spassed1249 msgctxt "utest.spassed"1250 msgid "Passed"1251 1237 msgstr "" 1252 1238 -
trunk/Languages/vCardStudio.sv.po
r138 r146 1272 1272 msgstr "" 1273 1273 1274 #: utest.sfailed1275 msgctxt "utest.sfailed"1276 msgid "Failed"1277 msgstr ""1278 1279 #: utest.snone1280 msgid "None"1281 msgstr ""1282 1283 1274 #: utest.soutput 1284 1275 msgid "Output:" 1285 msgstr ""1286 1287 #: utest.spassed1288 msgctxt "utest.spassed"1289 msgid "Passed"1290 1276 msgstr "" 1291 1277 -
trunk/Packages/Common/Common.lpk
r135 r146 42 42 <License Value="Copy left."/> 43 43 <Version Minor="10"/> 44 <Files Count="3 0">44 <Files Count="31"> 45 45 <Item1> 46 46 <Filename Value="StopWatch.pas"/> … … 175 175 <UnitName Value="UDataFile"/> 176 176 </Item30> 177 <Item31> 178 <Filename Value="UTestCase.pas"/> 179 <UnitName Value="UTestCase"/> 180 </Item31> 177 181 </Files> 178 182 <CompatibilityMode Value="True"/> -
trunk/UCore.pas
r135 r146 115 115 116 116 uses 117 UFormMain, UFormSettings, UFormContacts, UFormFindDuplicity, UTest ,117 UFormMain, UFormSettings, UFormContacts, UFormFindDuplicity, UTestCase, 118 118 UFormGenerate, UFormError, UFormFind, UFormTest, UFormSource, UFormCompare, 119 119 UTestCases, UVCardFile; … … 453 453 procedure TCore.TranslatorTranslate(Sender: TObject); 454 454 begin 455 UTest .Translate;455 UTestCase.Translate; 456 456 end; 457 457 -
trunk/UTest.pas
r138 r146 4 4 5 5 uses 6 Classes, SysUtils, Generics.Collections, UVCard ;6 Classes, SysUtils, Generics.Collections, UVCard, UTestCase; 7 7 8 8 type 9 TTestResult = (trNone, trPassed, trFailed);10 11 { TTestCase }12 13 TTestCase = class14 public15 Name: string;16 Result: TTestResult;17 Log: string;18 procedure Run; virtual;19 procedure Evaluate(Passed: Boolean);20 procedure Pass;21 procedure Fail;22 end;23 24 TTestCaseClass = class of TTestCase;25 26 { TTestCases }27 28 TTestCases = class(TObjectList<TTestCase>)29 function AddNew(Name: string; TestClass: TTestCaseClass): TTestCase;30 end;31 9 32 10 TTestCaseActionKind = (akNone, akRemoveExactDuplicates); … … 51 29 end; 52 30 53 resourcestring54 SNone = 'None';55 SPassed = 'Passed';56 SFailed = 'Failed';57 58 const59 ResultText: array[TTestResult] of string = (SNone, SPassed, SFailed);60 61 procedure Translate;62 63 31 64 32 implementation … … 70 38 SExpected = 'Expected:'; 71 39 SOutput = 'Output:'; 72 73 procedure Translate;74 begin75 ResultText[trNone] := SNone;76 ResultText[trPassed] := SPassed;77 ResultText[trFailed] := SFailed;78 end;79 40 80 41 { TTestCaseCheckProperty } … … 138 99 end; 139 100 140 { TTestCase }141 142 procedure TTestCase.Run;143 begin144 end;145 146 procedure TTestCase.Evaluate(Passed: Boolean);147 begin148 if Passed then Result := trPassed149 else Result := trFailed;150 end;151 152 procedure TTestCase.Pass;153 begin154 Result := trPassed;155 end;156 157 procedure TTestCase.Fail;158 begin159 Result := trFailed;160 end;161 162 { TTestCases }163 164 function TTestCases.AddNew(Name: string; TestClass: TTestCaseClass): TTestCase;165 begin166 Result := TestClass.Create;167 Result.Name := Name;168 Add(Result);169 end;170 171 101 end. 172 102 -
trunk/UTestCases.pas
r135 r146 4 4 5 5 uses 6 Classes, SysUtils, UTest ;6 Classes, SysUtils, UTest, UTestCase; 7 7 8 8 function InitTestCases: TTestCases; -
trunk/vCardStudio.lpi
r138 r146 271 271 <IsPartOfProject Value="True"/> 272 272 <ComponentName Value="FormColumns"/> 273 <HasResources Value="True"/> 273 274 <ResourceBaseClass Value="Form"/> 274 275 </Unit23>
Note:
See TracChangeset
for help on using the changeset viewer.