Add default score to b_best

Add doxyfile config
This commit is contained in:
2024-02-05 16:34:18 +01:00
parent c9dc378f98
commit 5993ece4fd
7 changed files with 2870 additions and 1 deletions

34
tests/TestResult.cc Normal file
View File

@@ -0,0 +1,34 @@
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "Result.h"
#include <filesystem>
TEST_CASE("Result class tests", "[Result]")
{
std::string testPath = "test_data";
std::string testFile = "test.json";
SECTION("Constructor and load method")
{
platform::Result result(testPath, testFile);
REQUIRE(result.date != "");
REQUIRE(result.score >= 0);
REQUIRE(result.scoreName != "");
REQUIRE(result.title != "");
REQUIRE(result.duration >= 0);
REQUIRE(result.model != "");
}
SECTION("to_string method")
{
platform::Result result(testPath, testFile);
std::string resultStr = result.to_string(1);
REQUIRE(resultStr != "");
}
SECTION("Exception handling in load method")
{
std::string invalidFile = "invalid.json";
REQUIRE_THROWS_AS(platform::Result(testPath, invalidFile), std::invalid_argument);
}
}