summaryrefslogtreecommitdiff
path: root/battleNetApi/tests/src/tokenTests.cpp
blob: 89e4039a1a0d150f29f7ee9760db1dc9e0d94539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
}