예제 #1
0
        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);
        }
예제 #2
0
 public VerifyModuleTests(ServerTestFixture fixture) : base(fixture)
 {
     registrar = new AccountRegistrar(fx.serverContext);
 }