All functions lie in the `Kazv::Factory` namespace. The header file to include is `<testfixtures/factory.hpp>`.
-```c++
+```cpp
#include <factory.hpp>
using namespace Kazv::Factory;
@@ -17,14 +17,14 @@
A `ComposedModifier<ModelType>` is basically a function that takes a `ModelType &` and modify it, so you can put a lambda here:
-```c++
+```cpp
auto client = makeClient([](ClientModel &m) { m.userId = "@some-user:example.com"; });
// client.userId == "@some-user:example.com"
```
Just as its name suggests, you can compose multiple `ComposedModifier` with `operator|()`, and they will execute in the sequence in which they are composed:
A `ComposedModifier<ModelType>` is an `std::function<void(ModelType &)>` but it won't throw when a default-constructed instance is being invoked, instead it would just do nothing, so you can write the following when you do not need any particular tweak:
-```c++
+```cpp
auto client = makeClient({});
```
@@ -43,7 +43,7 @@
To make our life easier, we defined some commonly used modifiers. The most generic one is `withAttr()`, which takes a pointer to a class member and a value. When invoked, it sets that member to the value provided.
-```c++
+```cpp
auto client = makeClient(
withAttr(&ClientModel::serverUrl, "tusooa.xyz")
| withAttr(&ClientModel::token, "token")
@@ -57,7 +57,7 @@
Some modifiers add values to a mapping, for example `withRoom()`, `withRoomState()`, `withRoomTimeline()`, `withRoomAccountData()`. They take care of the keys automatically so instead of writing