Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
Loading...
Searching...
No Matches
database::testing::fixtures Namespace Reference

Test fixture helpers. More...

Functions

core::database_result users_data ()
 Standard user table data.
 
core::database_result products_data ()
 Standard products table data.
 
core::database_result empty_result ()
 Empty result.
 

Detailed Description

Test fixture helpers.

Function Documentation

◆ empty_result()

core::database_result database::testing::fixtures::empty_result ( )
inline

Empty result.

Definition at line 172 of file database_test_utils.h.

172 {
173 return core::database_result{};
174}
std::vector< database_row > database_result

◆ products_data()

core::database_result database::testing::fixtures::products_data ( )
inline

Standard products table data.

Definition at line 161 of file database_test_utils.h.

161 {
162 return make_result({
163 {{"id", int64_t(1)}, {"name", std::string("Widget")}, {"price", 19.99}, {"quantity", int64_t(100)}},
164 {{"id", int64_t(2)}, {"name", std::string("Gadget")}, {"price", 29.99}, {"quantity", int64_t(50)}},
165 {{"id", int64_t(3)}, {"name", std::string("Thing")}, {"price", 9.99}, {"quantity", int64_t(200)}}
166 });
167}
core::database_result make_result(std::initializer_list< core::database_row > rows)
Helper function to create test data rows.

References database::testing::make_result().

Here is the call graph for this function:

◆ users_data()

core::database_result database::testing::fixtures::users_data ( )
inline

Standard user table data.

Definition at line 150 of file database_test_utils.h.

150 {
151 return make_result({
152 {{"id", int64_t(1)}, {"name", std::string("Alice")}, {"email", std::string("alice@example.com")}, {"active", true}},
153 {{"id", int64_t(2)}, {"name", std::string("Bob")}, {"email", std::string("bob@example.com")}, {"active", true}},
154 {{"id", int64_t(3)}, {"name", std::string("Charlie")}, {"email", std::string("charlie@example.com")}, {"active", false}}
155 });
156}

References database::testing::make_result().

Here is the call graph for this function: