DevDB.generateUsers

generateDevDB() function

struct DevDB
generateUsers
()

Examples

import std.uuid: UUID, sha1UUID;
import std.typecons: nullable;
auto devDB = DB(DevDB());
auto db = devDB.generateUsers();
logInfo(db[0].id.to!string);
assert(is(typeof(db) == User[]));
assert(is(typeof(db[0].id) == Nullable!UUID));
assert(is(typeof(db[0].email) == Nullable!UUID[]));
assert(is(typeof(db[0].username) == Nullable!string));
assert(is(typeof(db[0].password) == Nullable!string));
auto a = sha1UUID("user0@email.com", sha1UUID("konnex-engine.com"));
auto aa = a.nullable;
assert(db[0].id == a);
auto b = sha1UUID("user0@email.com", sha1UUID("konnex-engine.com")).nullable;
assert(db[0].email == [b]);
assert(db[0].username == "user0@email.com");
assert(db[0].password == "password0");

Meta