uTestCheckEmailTread.pas
上传用户:yjb1804
上传日期:2021-01-30
资源大小:3105k
文件大小:2k
- unit uTestCheckEmailTread;
- interface
- uses Classes,uCheckEmailThread,TestFramework;
- type
- TTestCheckEmailThread=class(TTestCase)
- private
- FResult:string;
- procedure NewEmail(Sender:TObject;NewEmailUIDLs:TStrings);
- protected
- procedure Setup;override;
- procedure TearDown;override;
- published
- procedure TestCheckEmail;
- end;
- implementation
- uses uCommon;
- { TTestCheckEmailThread }
- procedure TTestCheckEmailThread.NewEmail(Sender: TObject;
- NewEmailUIDLs: TStrings);
- begin
- FResult:=FResult+NewEmailUIDLs.Text;
- Status(FResult);
- end;
- procedure TTestCheckEmailThread.Setup;
- begin
- FResult:='';
- end;
- procedure TTestCheckEmailThread.TearDown;
- begin
- inherited;
- end;
- procedure TTestCheckEmailThread.TestCheckEmail;
- var
- checker:TCheckEmailThread;
- Acc:TAccounts;
- L:TStrings;
- begin
- SetLength(Acc,2);
- Acc[0].Pop3ServerAddr:='pop.21cn.com';
- Acc[0].SeverPort:=110;
- Acc[0].EmailAccount:='linuxpingwp@21cn.com';
- Acc[0].EmailPwd:='123456a';
- {Acc[1].Pop3ServerAddr:='pop.163.com';
- Acc[1].SeverPort:=110;
- Acc[1].EmailAccount:='wangpingdejiejie@163.com';
- Acc[1].EmailPwd:='123456'; }
- L:=TStringList.Create;
- L.Add('xtbBRh0tyUX0KxhvqwAAs5') ;
- L.Add('100.1.8sg5Y.460k.1235529423.linuxpingwp@21cn.com');
- L.Add('100.1.8sg5Y.460k.1235529423.linuxpingwp@21cn.com');
- checker:=TCheckEmailThread.Create(acc,L);
- L.Free;
- checker.OnNewEmailArrive:=NewEmail;
- checker.Resume;
- end;
- initialization
- TestFramework.RegisterTest(TTestCheckEmailThread.Suite );
- end.