Skip to content

Commit

Permalink
Added two tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcunningham committed Apr 5, 2015
1 parent 32c5ec5 commit 8bffcbc
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/GridRefUnitTests.pas
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ TGridRefUnitTest = class(TTestCase)
procedure Test05;
procedure Test06;
procedure Test07;
procedure Test08;
procedure Test09;
end;

implementation
Expand Down Expand Up @@ -111,6 +113,34 @@ procedure TGridRefUnitTest.Test07;
CheckTrue((temp1 = '53.33337') and (temp2 = '-0.15016'), 'TF 2328083424 as WGS84');
end;

procedure TGridRefUnitTest.Test08;
var
OS : TOSGridRef;
pWGS84, pOSGB : TLatLon;
temp1, temp2 : string;
begin
OS := TOSGridRef.Parse('TF 2328083424');
pOSGB := TOSGridRef.OSGridToLatLong(OS);
pWGS84 := ConvertOSGB36toWGS84(pOSGB);
temp1 := FormatFloat('##0.00000', pWGS84.Lat);
temp2 := FormatFloat('##0.00000', pWGS84.Lon);
CheckTrue((temp1 = '53.33337') and (temp2 = '-0.15016'), 'TF 2328083424 as WGS84');
end;

procedure TGridRefUnitTest.Test09;
var
OS : TOSGridRef;
pWGS84, pOSGB : TLatLon;
temp1, temp2 : string;
begin
OS := TOSGridRef.Parse('TF 23280 83424');
pOSGB := TOSGridRef.OSGridToLatLong(OS);
pWGS84 := ConvertOSGB36toWGS84(pOSGB);
temp1 := FormatFloat('##0.00000', pWGS84.Lat);
temp2 := FormatFloat('##0.00000', pWGS84.Lon);
CheckTrue((temp1 = '53.33337') and (temp2 = '-0.15016'), 'TF 2328083424 as WGS84');
end;


initialization
// Register any test cases with the test runner
Expand Down

0 comments on commit 8bffcbc

Please sign in to comment.