Changeset 199 for trunk/Test.pas
- Timestamp:
- Jan 28, 2026, 10:24:15 AM (5 hours ago)
- File:
-
- 1 edited
-
trunk/Test.pas (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Test.pas
r168 r199 19 19 end; 20 20 21 { TTestCaseCheckProperty } 22 23 TTestCaseCheckProperty = class(TTestCase) 24 Input: string; 21 { TTestCasePropertyRead } 22 23 TTestCasePropertyRead = class(TTestCase) 24 Input: string; 25 ContactIndex: Integer; 26 Index: TContactFieldIndex; 27 Value: string; 28 procedure Run; override; 29 end; 30 31 { TTestCasePropertyWrite } 32 33 TTestCasePropertyWrite = class(TTestCase) 34 Input: string; 35 Output: string; 25 36 ContactIndex: Integer; 26 37 Index: TContactFieldIndex; … … 140 151 end; 141 152 142 { TTestCase CheckProperty}143 144 procedure TTestCase CheckProperty.Run;153 { TTestCasePropertyRead } 154 155 procedure TTestCasePropertyRead.Run; 145 156 var 146 157 Lines: TStringList; … … 169 180 end; 170 181 182 { TTestCasePropertyWrite } 183 184 procedure TTestCasePropertyWrite.Run; 185 var 186 Lines: TStringList; 187 begin 188 Lines := TStringList.Create; 189 try 190 with TVCardFile.Create(nil) do 191 try 192 Lines.Text := Input; 193 VCard.LoadFromStrings(Lines); 194 if ContactIndex < VCard.Contacts.Count then begin 195 VCard.Contacts[ContactIndex].Fields[Index] := Value; 196 end else Fail; 197 Lines.Clear; 198 VCard.SaveToStrings(Lines); 199 Log := SExpected + LineEnding + 200 '"' + Output + '"' + LineEnding + LineEnding + 201 SOutput + LineEnding + 202 '"' + Lines.Text + '"'; 203 Evaluate(Lines.Text = Output); 204 finally 205 Free; 206 end; 207 finally 208 Lines.Free; 209 end; 210 end; 211 171 212 { TTestCaseLoadSave } 172 213
Note:
See TracChangeset
for help on using the changeset viewer.
