public static void CreateLocalAccount( IDocumentStore masterStore,string email,string password ,UserAccountService userAccountService)
 {
     if (userAccountService == null) return;
     var account=userAccountService.CreateAccount(null, password, email);
     account.RequiresPasswordReset = true;
     userAccountService.Update(account);
 }
            public void CanAuthenticateAnAccount(UserAccountService<HierarchicalUserAccount> service,
                string username, string password)
            {
                string email = $"{username}@example.com";
                service.CreateAccount(username, password, email);

                service.Authenticate(username, password).ShouldBe(true);
            }
            public void Test(UserAccountService<HierarchicalUserAccount> service,
                string username, string password, string certThumb)
            {
                string email = $"{username}@example.com";
                var account = service.CreateAccount(username, password, email);

                service.AddCertificate(account.ID, certThumb, username);
            }
            public void CanCreateANewUserAccount(UserAccountService<HierarchicalUserAccount> service,
                string username, string password)
            {
                string email = $"{username}@example.com";
                var account = service.CreateAccount(username, password, email);

                var fromDb = service.GetByID(account.ID);

                fromDb.ShouldNotBe(null);
                fromDb.Username.ShouldBe(username);
                fromDb.Email.ShouldBe(email);
            }
        private void InitDb()
        {
            using (var db = new BrockAllen.MembershipReboot.Ef.DefaultUserAccountRepository())
            {
                var svc = new UserAccountService(db);
                if (svc.GetByUsername("admin") == null)
                {
                    var account = svc.CreateAccount("admin", "admin123", "*****@*****.**");
                    svc.VerifyAccount(account.VerificationKey);

                    account = svc.GetByID(account.ID);
                    account.AddClaim(ClaimTypes.Role, "Administrator");
                    account.AddClaim(ClaimTypes.Role, "Manager");
                    account.AddClaim(ClaimTypes.Country, "USA");
                    svc.Update(account);
                }
            }
        }