Added empty skeleton implementations and tests for days 17, 18, and 19

This commit is contained in:
2023-12-19 17:57:58 +01:00
committed by Stefan Müller
parent 01ec0be32c
commit 58da932860
10 changed files with 492 additions and 2 deletions

View File

@@ -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>

View File

@@ -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}

View 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.

View 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.

View 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.