mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 14:49:07 +02:00
TAChart: Add test for random source extent
git-svn-id: trunk@26929 -
This commit is contained in:
parent
91ae387e7a
commit
c3e010c4ba
@ -25,8 +25,6 @@ uses
|
||||
|
||||
type
|
||||
|
||||
{ TIntervalListTest }
|
||||
|
||||
{ TListSourceTest }
|
||||
|
||||
TListSourceTest = class(TTestCase)
|
||||
@ -40,6 +38,13 @@ type
|
||||
procedure DataPoint;
|
||||
end;
|
||||
|
||||
{ TRandomSourceTest }
|
||||
|
||||
TRandomSourceTest = class(TTestCase)
|
||||
published
|
||||
procedure Extent;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
@ -87,9 +92,34 @@ begin
|
||||
inherited TearDown;
|
||||
end;
|
||||
|
||||
{ TRandomSourceTest }
|
||||
|
||||
procedure TRandomSourceTest.Extent;
|
||||
var
|
||||
s: TRandomChartSource;
|
||||
ext: TDoubleRect;
|
||||
begin
|
||||
s := TRandomChartSource.Create(nil);
|
||||
try
|
||||
s.XMin := 10;
|
||||
s.XMax := 20;
|
||||
s.YMin := 5;
|
||||
s.YMax := 6;
|
||||
s.PointsNumber := 1000;
|
||||
ext := s.Extent;
|
||||
AssertEquals(10, ext.a.X);
|
||||
AssertEquals(20, ext.b.X);
|
||||
Assert(ext.a.Y > 5);
|
||||
Assert(ext.b.Y < 6);
|
||||
Assert(ext.a.Y < ext.b.Y);
|
||||
finally
|
||||
s.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
RegisterTests([TListSourceTest]);
|
||||
RegisterTests([TListSourceTest, TRandomSourceTest]);
|
||||
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user