private void InitialiseEmployerProfile(Guid employerId) { var profile = _profilesQuery.GetEmployerProfile(employerId) ?? new EmployerProfile(); profile.UpdatedTermsReminder.Hide = true; _profilesCommand.UpdateEmployerProfile(employerId, profile); }
public void TestLegacyEmployer() { var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0)); // No profile before logging in. Assert.IsNull(_profilesQuery.GetEmployerProfile(employer.Id)); // As this is the first log in the user should be at home page and profile prompt and terms reminder should be shown. LogIn(employer); AssertUrl(LoggedInEmployerHomeUrl); //AssertTermsReminder(); AssertNoTermsReminder(); // Turned off for now AssertEmployerState(true, false, employer.Id); // Get the page again. Get(LoggedInEmployerHomeUrl); AssertUrl(LoggedInEmployerHomeUrl); AssertNoTermsReminder(); AssertEmployerState(true, false, employer.Id); // Log out and back in again. LogOut(); LogIn(employer); AssertUrl(LoggedInEmployerHomeUrl); AssertNoTermsReminder(); AssertEmployerState(true, false, employer.Id); // Go to the terms page. Get(_termsUrl); AssertUrl(_termsUrl); // Go back to the home page. Get(LoggedInEmployerHomeUrl); AssertUrl(LoggedInEmployerHomeUrl); AssertNoTermsReminder(); AssertEmployerState(true, true, employer.Id); }
public void TestChangePasswordWithOtherConfirmation() { var user = CreateUser(); LogIn(user); // Set state so the user gets the terms reminder when they get redirected back to the home page. var profile = _profilesQuery.GetEmployerProfile(user.Id); Assert.IsNull(profile); /* Turned off at the moment. * state.UpdatedTermsReminder.Hide = false; * state.UpdatedTermsReminder.FirstShownTime = null; * _stateCommand.UpdateEmployerState(user.Id, state); */ Get(_changePasswordUrl); _passwordTextBox.Text = Password; _newPasswordTextBox.Text = NewPassword; _confirmNewPasswordTextBox.Text = NewPassword; _saveButton.Click(); // Check. AssertUrlWithoutQuery(GetHomeUrl()); AssertNoErrorMessages(); AssertConfirmationMessages("Your password has been changed."); // AssertConfirmationMessages("Your password has been changed.", "We've made some changes to our terms and conditions. You can review them here."); // Try to login with the old password. LogOut(); LogIn(user); AssertNotLoggedIn(); LogIn(user, NewPassword); AssertUrl(GetHomeUrl()); }
private SettingsPropertyValueCollection GetPropertyValues(Guid userId, IEnumerable collection) { var properties = new SettingsPropertyValueCollection(); foreach (SettingsProperty property in collection) { var value = new SettingsPropertyValue(property); switch (property.Name) { case EmployerProfile: value.PropertyValue = _profilesQuery.GetEmployerProfile(userId) ?? new EmployerProfile(); break; case MemberProfile: value.PropertyValue = _profilesQuery.GetMemberProfile(userId) ?? new MemberProfile(); break; } properties.Add(value); } return(properties); }