generated from cpp-best-practices/gui_starter_template
-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathtests.cpp
More file actions
29 lines (22 loc) · 597 Bytes
/
tests.cpp
File metadata and controls
29 lines (22 loc) · 597 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "test_json.hpp"
#include <catch2/catch_test_macros.hpp>
TEST_CASE("Can read object size")
{
const auto &document = compiled_json::test_json::get();
REQUIRE(document.size() == 1);
}
TEST_CASE("Can iterate object")
{
const auto &document = compiled_json::test_json::get();
std::size_t elements = 0;
for (const auto &json : document) {
REQUIRE(!json.is_null());
++elements;
}
REQUIRE(elements == document.size());
}
TEST_CASE("Can read iterator key")
{
const auto &document = compiled_json::test_json::get();
REQUIRE(document.begin().key() == "glossary");
}