protected override void TestCleanup()
        {
            new LinqMetaData().User
            .Where(x => x.FirstName == "UserTest" || x.FirstName == "UserTest1")
            .ToList().ForEach(x =>
            {
                var ars = x.UserAccountRestrictions.Select(y => y.AccountRestriction).ToList();
                x.UserAccountRestrictions.DeleteMulti();
                ars.ForEach(y => y.Delete());
                x.Delete();
            });
            // delete restrictions on epic admin
            var user = TestData.OrgAdminUser;

            Assert.IsNotNull(user);
            var adminArs = user.UserAccountRestrictions.Select(y => y.AccountRestriction).ToList();

            user.UserAccountRestrictions.DeleteMulti();
            adminArs.ForEach(y => y.Delete());
            var transaction = new Transaction(IsolationLevel.ReadCommitted, "reset");

            EpicMembershipProvider.SetPassword(user, TestData.OrgAdminPassword, transaction);
            transaction.Add(user);
            user.Save();
            transaction.Commit();

            base.TestCleanup();
        }
    /// <summary>
    /// Sets the password for a user, not typically allowed by MembershipProvider.
    /// </summary>
    /// <param name="user"></param>
    /// <param name="password"></param>
    /// <returns></returns>
    public static bool SetPassword(this MembershipUser user, string password)
    {
        Transaction transaction = new Transaction(System.Data.IsolationLevel.ReadCommitted, "password change");

        try
        {
            int        userId     = user.GetUserId().Id;
            UserEntity userEntity = new UserEntity(userId);
            if (!userEntity.IsNew)
            {
                transaction.Add(userEntity);
                EpicMembershipProvider.SetPassword(userEntity, password, transaction);
                userEntity.Save();

                transaction.Commit();

                return(true);
            }
            else
            {
                return(false);
            }
        }
        catch
        {
            transaction.Rollback();

            return(false);
        }
        finally
        {
            transaction.Dispose();
        }
    }
        private static void Cleanup()
        {
            var user        = new LinqMetaData().User.FirstOrDefault(x => x.Username == TestData.OrgAdminUsername);
            var transaction = new Transaction(IsolationLevel.ReadCommitted, "reset");

            EpicMembershipProvider.SetPassword(user, TestData.OrgAdminPassword, transaction);
            transaction.Add(user);
            user.Save();
            transaction.Commit();
        }
        private static void Cleanup()
        {
            var user        = TestData.OrgAdminUser;
            var transaction = new Transaction(IsolationLevel.ReadCommitted, "reset");

            EpicMembershipProvider.SetPassword(user, TestData.OrgAdminPassword, transaction);
            transaction.Add(user);
            user.Save();
            transaction.Commit();
        }