Changeset 129 for trunk/UTest.pas


Ignore:
Timestamp:
Apr 9, 2022, 11:52:13 AM (3 years ago)
Author:
chronos
Message:
  • Added: TVCard as TComponent descendant.
  • Modified: TContactsFile renamed to TVCardFile and moved into separate file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTest.pas

    r128 r129  
    44
    55uses
    6   Classes, SysUtils, Generics.Collections, UContact;
     6  Classes, SysUtils, Generics.Collections, UVCard;
    77
    88type
     
    6464implementation
    6565
     66uses
     67  UVCardFile;
     68
    6669resourcestring
    6770  SExpected = 'Expected:';
     
    8487  Lines := TStringList.Create;
    8588  try
    86     with TContactsFile.Create do
     89    with TVCardFile.Create do
    8790    try
    8891      Lines.Text := Input;
    89       LoadFromStrings(Lines);
    90       if ContactIndex < Contacts.Count then begin
    91         PropertyValue := Contacts[ContactIndex].Fields[Index];
     92      VCard.LoadFromStrings(Lines);
     93      if ContactIndex < VCard.Contacts.Count then begin
     94        PropertyValue := VCard.Contacts[ContactIndex].Fields[Index];
    9295        Evaluate(PropertyValue = Value);
    9396      end else Fail;
     
    112115  Lines := TStringList.Create;
    113116  try
    114     with TContactsFile.Create do
     117    with TVCardFile.Create do
    115118    try
    116119      Lines.Text := Input;
    117       LoadFromStrings(Lines);
     120      VCard.LoadFromStrings(Lines);
    118121
    119122      if Action = akRemoveExactDuplicates then
    120         Contacts.RemoveExactDuplicates;
     123        VCard.Contacts.RemoveExactDuplicates;
    121124
    122125      Lines.Text := '';
    123       SaveToStrings(Lines);
     126      VCard.SaveToStrings(Lines);
    124127      Evaluate(Lines.Text = Output);
    125128      Log := SExpected + LineEnding +
Note: See TracChangeset for help on using the changeset viewer.