Added empty skeleton implementations and tests for days 17, 18, and 19
This commit is contained in:
@@ -108,6 +108,18 @@
|
||||
<Filename Value="UFloorWillBeLavaTestCases.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit>
|
||||
<Unit>
|
||||
<Filename Value="UClumsyCrucibleTestCases.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit>
|
||||
<Unit>
|
||||
<Filename Value="ULavaductLagoonTestCases.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit>
|
||||
<Unit>
|
||||
<Filename Value="UAplentyTestCases.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
||||
@@ -7,7 +7,7 @@ uses
|
||||
UGearRatiosTestCases, UScratchcardsTestCases, UGiveSeedFertilizerTestCases, UWaitForItTestCases, UCamelCardsTestCases,
|
||||
UHauntedWastelandTestCases, UMirageMaintenanceTestCases, UPipeMazeTestCases, UCosmicExpansionTestCases,
|
||||
UHotSpringsTestCases, UPointOfIncidenceTestCases, UParabolicReflectorDishTestCases, ULensLibraryTestCases,
|
||||
UFloorWillBeLavaTestCases;
|
||||
UFloorWillBeLavaTestCases, UClumsyCrucibleTestCases, ULavaductLagoonTestCases, UAplentyTestCases;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
|
||||
90
tests/UAplentyTestCases.pas
Normal file
90
tests/UAplentyTestCases.pas
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
Solutions to the Advent Of Code.
|
||||
Copyright (C) 2023 Stefan Müller
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation, either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
unit UAplentyTestCases;
|
||||
|
||||
{$mode ObjFPC}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit, testregistry, USolver, UBaseTestCases, UAplenty;
|
||||
|
||||
type
|
||||
|
||||
{ TAplentyFullDataTestCase }
|
||||
|
||||
TAplentyFullDataTestCase = class(TEngineBaseTest)
|
||||
protected
|
||||
function CreateSolver: ISolver; override;
|
||||
published
|
||||
procedure TestPart1;
|
||||
procedure TestPart2;
|
||||
end;
|
||||
|
||||
{ TAplentyExampleTestCase }
|
||||
|
||||
TAplentyExampleTestCase = class(TExampleEngineBaseTest)
|
||||
protected
|
||||
function CreateSolver: ISolver; override;
|
||||
published
|
||||
procedure TestPart1;
|
||||
procedure TestPart2;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TAplentyFullDataTestCase }
|
||||
|
||||
function TAplentyFullDataTestCase.CreateSolver: ISolver;
|
||||
begin
|
||||
Result := TAplenty.Create;
|
||||
end;
|
||||
|
||||
procedure TAplentyFullDataTestCase.TestPart1;
|
||||
begin
|
||||
AssertEquals(-1, FSolver.GetResultPart1);
|
||||
end;
|
||||
|
||||
procedure TAplentyFullDataTestCase.TestPart2;
|
||||
begin
|
||||
AssertEquals(-1, FSolver.GetResultPart2);
|
||||
end;
|
||||
|
||||
{ TAplentyExampleTestCase }
|
||||
|
||||
function TAplentyExampleTestCase.CreateSolver: ISolver;
|
||||
begin
|
||||
Result := TAplenty.Create;
|
||||
end;
|
||||
|
||||
procedure TAplentyExampleTestCase.TestPart1;
|
||||
begin
|
||||
AssertEquals(19114, FSolver.GetResultPart1);
|
||||
end;
|
||||
|
||||
procedure TAplentyExampleTestCase.TestPart2;
|
||||
begin
|
||||
AssertEquals(-1, FSolver.GetResultPart2);
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
RegisterTest(TAplentyFullDataTestCase);
|
||||
RegisterTest(TAplentyExampleTestCase);
|
||||
end.
|
||||
|
||||
90
tests/UClumsyCrucibleTestCases.pas
Normal file
90
tests/UClumsyCrucibleTestCases.pas
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
Solutions to the Advent Of Code.
|
||||
Copyright (C) 2023 Stefan Müller
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation, either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
unit UClumsyCrucibleTestCases;
|
||||
|
||||
{$mode ObjFPC}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit, testregistry, USolver, UBaseTestCases, UClumsyCrucible;
|
||||
|
||||
type
|
||||
|
||||
{ TClumsyCrucibleFullDataTestCase }
|
||||
|
||||
TClumsyCrucibleFullDataTestCase = class(TEngineBaseTest)
|
||||
protected
|
||||
function CreateSolver: ISolver; override;
|
||||
published
|
||||
procedure TestPart1;
|
||||
procedure TestPart2;
|
||||
end;
|
||||
|
||||
{ TClumsyCrucibleExampleTestCase }
|
||||
|
||||
TClumsyCrucibleExampleTestCase = class(TExampleEngineBaseTest)
|
||||
protected
|
||||
function CreateSolver: ISolver; override;
|
||||
published
|
||||
procedure TestPart1;
|
||||
procedure TestPart2;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TClumsyCrucibleFullDataTestCase }
|
||||
|
||||
function TClumsyCrucibleFullDataTestCase.CreateSolver: ISolver;
|
||||
begin
|
||||
Result := TClumsyCrucible.Create;
|
||||
end;
|
||||
|
||||
procedure TClumsyCrucibleFullDataTestCase.TestPart1;
|
||||
begin
|
||||
AssertEquals(-1, FSolver.GetResultPart1);
|
||||
end;
|
||||
|
||||
procedure TClumsyCrucibleFullDataTestCase.TestPart2;
|
||||
begin
|
||||
AssertEquals(-1, FSolver.GetResultPart2);
|
||||
end;
|
||||
|
||||
{ TClumsyCrucibleExampleTestCase }
|
||||
|
||||
function TClumsyCrucibleExampleTestCase.CreateSolver: ISolver;
|
||||
begin
|
||||
Result := TClumsyCrucible.Create;
|
||||
end;
|
||||
|
||||
procedure TClumsyCrucibleExampleTestCase.TestPart1;
|
||||
begin
|
||||
AssertEquals(102, FSolver.GetResultPart1);
|
||||
end;
|
||||
|
||||
procedure TClumsyCrucibleExampleTestCase.TestPart2;
|
||||
begin
|
||||
AssertEquals(-1, FSolver.GetResultPart2);
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
RegisterTest(TClumsyCrucibleFullDataTestCase);
|
||||
RegisterTest(TClumsyCrucibleExampleTestCase);
|
||||
end.
|
||||
|
||||
90
tests/ULavaductLagoonTestCases.pas
Normal file
90
tests/ULavaductLagoonTestCases.pas
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
Solutions to the Advent Of Code.
|
||||
Copyright (C) 2023 Stefan Müller
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation, either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
unit ULavaductLagoonTestCases;
|
||||
|
||||
{$mode ObjFPC}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit, testregistry, USolver, UBaseTestCases, ULavaductLagoon;
|
||||
|
||||
type
|
||||
|
||||
{ TLavaductLagoonFullDataTestCase }
|
||||
|
||||
TLavaductLagoonFullDataTestCase = class(TEngineBaseTest)
|
||||
protected
|
||||
function CreateSolver: ISolver; override;
|
||||
published
|
||||
procedure TestPart1;
|
||||
procedure TestPart2;
|
||||
end;
|
||||
|
||||
{ TLavaductLagoonExampleTestCase }
|
||||
|
||||
TLavaductLagoonExampleTestCase = class(TExampleEngineBaseTest)
|
||||
protected
|
||||
function CreateSolver: ISolver; override;
|
||||
published
|
||||
procedure TestPart1;
|
||||
procedure TestPart2;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TLavaductLagoonFullDataTestCase }
|
||||
|
||||
function TLavaductLagoonFullDataTestCase.CreateSolver: ISolver;
|
||||
begin
|
||||
Result := TLavaductLagoon.Create;
|
||||
end;
|
||||
|
||||
procedure TLavaductLagoonFullDataTestCase.TestPart1;
|
||||
begin
|
||||
AssertEquals(-1, FSolver.GetResultPart1);
|
||||
end;
|
||||
|
||||
procedure TLavaductLagoonFullDataTestCase.TestPart2;
|
||||
begin
|
||||
AssertEquals(-1, FSolver.GetResultPart2);
|
||||
end;
|
||||
|
||||
{ TLavaductLagoonExampleTestCase }
|
||||
|
||||
function TLavaductLagoonExampleTestCase.CreateSolver: ISolver;
|
||||
begin
|
||||
Result := TLavaductLagoon.Create;
|
||||
end;
|
||||
|
||||
procedure TLavaductLagoonExampleTestCase.TestPart1;
|
||||
begin
|
||||
AssertEquals(62, FSolver.GetResultPart1);
|
||||
end;
|
||||
|
||||
procedure TLavaductLagoonExampleTestCase.TestPart2;
|
||||
begin
|
||||
AssertEquals(-1, FSolver.GetResultPart2);
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
RegisterTest(TLavaductLagoonFullDataTestCase);
|
||||
RegisterTest(TLavaductLagoonExampleTestCase);
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user