diff --git a/tests/include/aocTests/TestContext.hpp b/tests/include/aocTests/TestContext.hpp index dcdebfd..b17187e 100644 --- a/tests/include/aocTests/TestContext.hpp +++ b/tests/include/aocTests/TestContext.hpp @@ -26,6 +26,8 @@ class TestContext public: void run(const std::unique_ptr&& solver, const long long int expected1, const long long int expected2, const std::vector& inputPaths); + void runPart1(const std::unique_ptr&& solver, const long long int expected, + const std::vector& inputPaths); void runPart2(const std::unique_ptr&& solver, const long long int expected, const std::vector& inputPaths); std::vector getInputPaths() const; diff --git a/tests/src/TestContext.cpp b/tests/src/TestContext.cpp index f3697be..96b3803 100644 --- a/tests/src/TestContext.cpp +++ b/tests/src/TestContext.cpp @@ -29,6 +29,15 @@ void TestContext::run(const std::unique_ptr&& solver, const long long in REQUIRE(expected2 == solver->getResultPart2()); } +void TestContext::runPart1(const std::unique_ptr&& solver, const long long int expected, + const std::vector& inputPaths) +{ + SolverEngine solverEngine{ inputPaths }; + solverEngine.run(*solver); + + REQUIRE(expected == solver->getResultPart1()); +} + void TestContext::runPart2(const std::unique_ptr&& solver, const long long int expected, const std::vector& inputPaths) {