It looks to me that you're creating an abstraction on top of an abstraction for no real purpose and with no real benefit. I have issues with the way ASP.NET Providers were implemented (for testability), but I addressed that in another way.
What I did was create a class that Wrapped the MembershipProvider and implemented an interface. All it does is pass methods calls to the MembershipProvider, but it allows me to rely on the interface instead of the implementation. In my tests, I can swap out IMembershipProvider for a mocked version.
edit, sample code:
IMembershipService
// Membership service that just provides Create/Delete
public interface IMembershipService
{
IMembershipUser CreateUser(string username, string password);
void DeleteUser(string username);
}
and IMembershipUser
// IMembershipUser that provides a lot of the necessary details
public interface IMembershipUser
{
string UserName { get; }
bool IsApproved { get; }
bool IsLockedOut { get; }
string Email { get; }
DateTime LastLoginDate { get; }
DateTime CreationDate { get; }
bool ChangePassword(string oldPassword, string newPassword);
string ResetPassword();
Guid UserID { get; }
}
and a simple wrapper for ASP.NET provider:
public class MembershipWrapper : IMembershipFactory
{
#region IMembership Members
public IMembershipUser CreateUser(string email, string password)
{
var user = System.Web.Security.Membership.CreateUser(email, password, email);
return new MembershipUserWrapper(user);
}
public void DeleteUser(string userName)
{
System.Web.Security.Membership.DeleteUser(userName);
}
#endregion
}
and MembershipUser
public class MembershipUserWrapper : IMembershipUser
{
private MembershipUser _User;
public MembershipUserWrapper(MembershipUser user)
{
_User = user;
}
#region IMembershipUser Members
public string ResetPassword()
{
return _User.ResetPassword();
}
public bool ChangePassword(string oldPassword, string newPassword)
{
return _User.ChangePassword(oldPassword, newPassword);
}
public string UserName
{
get { return _User.UserName; }
}
public bool IsApproved
{
get { return _User.IsApproved; }
}
public bool IsLockedOut
{
get { return _User.IsLockedOut; }
}
public string Email
{
get { return _User.Email; }
}
public DateTime LastLoginDate
{
get { return _User.LastLoginDate; }
}
public DateTime CreationDate
{
get { return _User.CreationDate; }
}
public Guid UserID
{
get { return (Guid)_User.ProviderUserKey; }
}
#endregion
}
Very simple implementation, but you can go to town with it.