summaryrefslogtreecommitdiff
path: root/battleNetApi/tests/src/tokenTests.cpp
diff options
context:
space:
mode:
authorAotrix <[email protected]>2026-07-13 00:23:36 +0200
committerAotrix <[email protected]>2026-07-13 00:23:36 +0200
commit552017342ed077ec9a516b02ea4b6855a7c17007 (patch)
treeaca50984a334049392cd0d3eb8e4c4efe65a2909 /battleNetApi/tests/src/tokenTests.cpp
parenta0632d299b85dc4ef7c0e03898f38e6deca0edc2 (diff)
Added test file for Token
Diffstat (limited to 'battleNetApi/tests/src/tokenTests.cpp')
-rw-r--r--battleNetApi/tests/src/tokenTests.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/battleNetApi/tests/src/tokenTests.cpp b/battleNetApi/tests/src/tokenTests.cpp
new file mode 100644
index 0000000..89e4039
--- /dev/null
+++ b/battleNetApi/tests/src/tokenTests.cpp
@@ -0,0 +1,20 @@
+#include <catch2/benchmark/catch_benchmark.hpp>
+#include <catch2/benchmark/catch_chronometer.hpp>
+#include <catch2/benchmark/detail/catch_analyse.hpp>
+#include <catch2/benchmark/detail/catch_benchmark_function.hpp>
+#include <catch2/benchmark/detail/catch_estimate_clock.hpp>
+#include <catch2/catch_approx.hpp>
+#include <catch2/catch_config.hpp>
+#include <catch2/catch_test_macros.hpp>
+#include <nlohmann/json.hpp>
+#include <string>
+#include <tokenBuilder.hpp>
+
+TEST_CASE("Retrieve API Token", "[generateApiToken]") {
+ const std::string aCredentialsFile{"../tests/resources/credentials.json"};
+ Token aToken(aCredentialsFile, std::chrono::seconds(0));
+ const std::string aTokenContent{aToken.text()};
+ const std::string::size_type aTokenSize{aTokenContent.size()};
+ REQUIRE(aTokenSize >= 30);
+ REQUIRE(aTokenSize <= 40);
+}