public void AgencyPasswordPolicy_ValidatePasswordForInvalidReuseCount() { DeveloperIdentity.GetDeveloperIdentity(); const string password = "******"; Guid userId = Utils.CreateUser(password); UserNew userdetails = new UserNew() { PasswordHistory = new Collection <PasswordHistory>() { new PasswordHistory(new Password(new Guid(), userId, "abc")), new PasswordHistory(new Password(new Guid(), userId, "xyz")) } }; passwordConfiguration = new PasswordConfigurationNew(); passwordConfiguration.PasswordPolicy = true; passwordConfiguration.PasswordReuse = 5; passwordConfiguration.MaximumLength = 15; controllerInstance = new AgencyPasswordPolicy(passwordConfiguration); passwordViolations = controllerInstance.ValidatePasswordChange(userdetails, password); Assert.IsFalse(passwordViolations.Count > 0); }
public void InitializeTest() { DeveloperIdentity.GetDeveloperIdentity(); }