Files
lazarus-ccr/components/svn/test/testsvnclasses.pas
vsnijders f62ba9ec2d started classes to interpreted svn commands
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@88 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2007-02-26 23:04:58 +00:00

61 lines
1.2 KiB
ObjectPascal

unit TestSvnClasses;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, fpcunit, testutils, testregistry,
svnclasses;
type
{ TTestSvnClasses }
TTestSvnClasses= class(TTestCase)
private
function GetInfoFileName: string;
published
procedure TestHookUp;
procedure TestLoadInfo;
end;
implementation
function TTestSvnClasses.GetInfoFileName: string;
begin
Result := ExtractFilePath(ParamStr(0)) + 'info.xml';
end;
procedure TTestSvnClasses.TestHookUp;
var
InfoFileName: string;
begin
InfoFileName := GetInfoFileName;
AssertTrue(InfoFileName + ' does not exist', FileExists(InfoFileName));
end;
procedure TTestSvnClasses.TestLoadInfo;
var
SvnInfo: TSvnInfo;
begin
SvnInfo := TSvnInfo.Create;
try
SvnInfo.LoadFromFile(GetInfoFileName);
AssertEquals('Wrong revision', 10685, SvnInfo.Entry.Revision);
AssertEquals('Wrong path', '.', SvnInfo.Entry.Path);
AssertEquals('Wrong kind', ord(ekDirectory), ord(SvnInfo.Entry.Kind));
AssertEquals('Wrong URL',
'svn+ssh://www.freepascal.org/FPC/svn/lazarus/trunk',
SvnInfo.Entry.URL);
finally
SvnInfo.Free;
end;
end;
initialization
RegisterTest(TTestSvnClasses);
end.