summaryrefslogtreecommitdiff
path: root/battleNetApi/tests/src/tokenTests.cpp
blob: 2e2d5b483bf10d8d3ddf7e26f564bf8680798da3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#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("Token", "[Token is expired]") {
    const std::string aCredentialsFile{"../tests/resources/credentials.json"};
    Token aToken(aCredentialsFile, std::chrono::seconds(0));
    REQUIRE(aToken.isExpired());
}

TEST_CASE("Token", "[Token is not expired]") {
    const std::string aCredentialsFile{"../tests/resources/credentials.json"};
    Token aToken(aCredentialsFile, std::chrono::seconds(20));
    REQUIRE_FALSE(aToken.isExpired());
}