Refactored the Trebuchet test cases

This commit is contained in:
Stefan Müller 2023-12-09 01:00:36 +01:00 committed by Stefan Müller
parent 95e06e2b10
commit 269643ad2a
1 changed files with 11 additions and 11 deletions

View File

@ -45,15 +45,15 @@ type
procedure TestPart1;
end;
{ TPart2ExampleTrebuchet }
{ TExample2Trebuchet }
TPart2ExampleTrebuchet = class(TTrebuchet)
TExample2Trebuchet = class(TTrebuchet)
function GetDataFileName: string; override;
end;
{ TTrebuchetPart2ExampleTestCase }
{ TTrebuchetExample2TestCase }
TTrebuchetPart2ExampleTestCase = class(TExampleEngineBaseTest)
TTrebuchetExample2TestCase = class(TExampleEngineBaseTest)
protected
function CreateSolver: ISolver; override;
published
@ -91,21 +91,21 @@ begin
AssertEquals(142, FSolver.GetResultPart1);
end;
{ TPart2ExampleTrebuchet }
{ TExample2Trebuchet }
function TPart2ExampleTrebuchet.GetDataFileName: string;
function TExample2Trebuchet.GetDataFileName: string;
begin
Result := 'trebuchet_calibration_document2.txt';
end;
{ TTrebuchetPart2ExampleTestCase }
{ TTrebuchetExample2TestCase }
function TTrebuchetPart2ExampleTestCase.CreateSolver: ISolver;
function TTrebuchetExample2TestCase.CreateSolver: ISolver;
begin
Result := TPart2ExampleTrebuchet.Create;
Result := TExample2Trebuchet.Create;
end;
procedure TTrebuchetPart2ExampleTestCase.TestPart2;
procedure TTrebuchetExample2TestCase.TestPart2;
begin
AssertEquals(281, FSolver.GetResultPart2);
end;
@ -114,5 +114,5 @@ initialization
RegisterTest(TTrebuchetFullDataTestCase);
RegisterTest(TTrebuchetExampleTestCase);
RegisterTest(TTrebuchetPart2ExampleTestCase);
RegisterTest(TTrebuchetExample2TestCase);
end.