1 #include <gtest/gtest.h>
5 using namespace std::literals::string_literals;
18 : props{
"style"s, {
"reqField"s,
"reqField2"s}, {
"optField"s}},
19 completeElement{
"id"s,
22 {
"reqField"s,
"a value"s},
23 {
"reqField2"s,
"a value"s},
24 {
"optField"s,
"a value"s}
26 incompleteElement{
"id"s,
29 {
"reqField2"s,
"value"s}
35 ASSERT_TRUE(completeElement.isCompliantTo(props));
39 ASSERT_FALSE(incompleteElement.isCompliantTo(props));
42 TEST(BibelementTests, constructionTest) {
43 std::vector<Field> fields = {
44 Field{
"name"s,
"value"s},
45 Field{
"another name"s,
"another value"s}
47 ASSERT_NO_THROW(([&](){
48 const auto a =
BibElement{
"an id"s,
"a style"s, fields};
50 ASSERT_NO_THROW(([&](){
51 const auto a =
BibElement{
"another id"s,
"another style"s, fields};