public virtual async Task InitializeAsync() { client = fx.getClient(); var registrar = new AccountRegistrar(fx.serverContext); var username = $"{AccountRegistrar.TEST_USERNAME}_{StringUtils.secureRandomString(8)}"; var authedUser = await registrar.registerAccount(client, username); user = authedUser.user; token = authedUser.token; client.addBearerToken(token); // store auth in client // verify user var findUser = fx.serverContext.userManager.findByUsername(username); findUser.role = User.Role.User; fx.serverContext.userManager.updateUser(findUser); }
public VerifyModuleTests(ServerTestFixture fixture) : base(fixture) { registrar = new AccountRegistrar(fx.serverContext); }