Esempio n. 1
0
 public void Ctor_InitializesNothing()
 {
     var entity = new LocalMembership();
     entity.Id.ShouldEqual(0);
     entity.User.ShouldBeNull();
     entity.PasswordHash.ShouldBeNull();
 }
Esempio n. 2
0
        public void UserPasswordStoreInterface_HasPasswordAsync_DelegatesToUserLocalMembershipProperty(string passwordHash, bool expect)
        {
            var instance        = new SecurityStore(null) as IUserPasswordStore <User, int>;
            var user            = new User();
            var localMembership = new LocalMembership {
                PasswordHash = passwordHash
            };

            user.LocalMembership = localMembership;
            var result = instance.HasPasswordAsync(user).Result;

            result.ShouldEqual(expect);
        }
Esempio n. 3
0
        public void UserPasswordStoreInterface_GetPasswordHashAsync_DelegatesToUserLocalMembershipProperty()
        {
            var instance        = new SecurityStore(null) as IUserPasswordStore <User, int>;
            var user            = new User();
            var localMembership = new LocalMembership {
                PasswordHash = Guid.NewGuid().ToString()
            };

            user.LocalMembership = localMembership;
            var result = instance.GetPasswordHashAsync(user).Result;

            result.ShouldEqual(localMembership.PasswordHash);
            result.ShouldEqual(user.LocalMembership.PasswordHash);
        }
 public ChangeLocalAccountPasswordEvent(LocalMembership membership)
 {
     Membership = membership;
 }
 public CustomerAccountCreatedEvent(string email, LocalMembership membership)
 {
     Email      = email;
     Membership = membership;
 }
Esempio n. 6
0
 public void UserPasswordStoreInterface_HasPasswordAsync_DelegatesToUserLocalMembershipProperty(string passwordHash, bool expect)
 {
     var instance = new SecurityStore(null) as IUserPasswordStore<User, int>;
     var user = new User();
     var localMembership = new LocalMembership { PasswordHash = passwordHash };
     user.LocalMembership = localMembership;
     var result = instance.HasPasswordAsync(user).Result;
     result.ShouldEqual(expect);
 }
Esempio n. 7
0
 public void UserPasswordStoreInterface_GetPasswordHashAsync_DelegatesToUserLocalMembershipProperty()
 {
     var instance = new SecurityStore(null) as IUserPasswordStore<User, int>;
     var user = new User();
     var localMembership = new LocalMembership { PasswordHash = Guid.NewGuid().ToString() };
     user.LocalMembership = localMembership;
     var result = instance.GetPasswordHashAsync(user).Result;
     result.ShouldEqual(localMembership.PasswordHash);
     result.ShouldEqual(user.LocalMembership.PasswordHash);
 }