Beispiel #1
0
        private void InitialiseMemberProfile(Guid memberId)
        {
            var profile = _profilesQuery.GetMemberProfile(memberId) ?? new MemberProfile();

            profile.UpdateStatusReminder.Hide = true;
            profile.UpdatedTermsReminder.Hide = true;
            _profilesCommand.UpdateMemberProfile(memberId, profile);
        }
Beispiel #2
0
        public void TestLegacyMemberProfileTimeOut()
        {
            var member = _memberAccountsCommand.CreateTestMember(0);

            // As this is the first log in the user should be at home page and prompt should be shown.

            LogIn(member);
            AssertUrl(LoggedInMemberHomeUrl);

            // Turned off for now
            //AssertProfilePrompt();
            AssertNoProfilePrompt();
            AssertNoProfileReminder();
            //AssertTermsReminder();
            AssertNoTermsReminder();
            AssertMemberState(/*true*/ false, false, true, false, member.Id);

            // Go beyond reminder time.

            var profile = _profilesQuery.GetMemberProfile(member.Id);

            profile.UpdateStatusReminder.FirstShownTime = DateTime.Now.AddMonths(-1).AddDays(-1);
            _profilesCommand.UpdateMemberProfile(member.Id, profile);

            // Get the page again.

            Get(LoggedInMemberHomeUrl);
            AssertUrl(LoggedInMemberHomeUrl);
            AssertNoProfilePrompt();
            AssertNoProfileReminder();
            AssertNoTermsReminder();
            AssertMemberState(true, false, true, false, member.Id);

            // Log out and back in again.

            LogOut();
            LogIn(member);
            AssertUrl(LoggedInMemberHomeUrl);
            AssertNoProfilePrompt();
            AssertNoProfileReminder();
            AssertNoTermsReminder();
            AssertMemberState(true, false, true, false, member.Id);

            // Go to the profile page.

            Get(_profileUrl);
            AssertUrl(_profileUrl);

            // Go back to the home page.

            Get(LoggedInMemberHomeUrl);
            AssertUrl(LoggedInMemberHomeUrl);
            AssertNoProfilePrompt();
            AssertNoProfileReminder();
            AssertNoTermsReminder();
            AssertMemberState(true, true, true, false, member.Id);
        }
Beispiel #3
0
        private void SetPropertyValues(Guid userId, IEnumerable collection)
        {
            foreach (SettingsPropertyValue property in collection)
            {
                switch (property.Name)
                {
                case EmployerProfile:
                    var employerProfile = property.PropertyValue as EmployerProfile;
                    if (employerProfile != null)
                    {
                        _profilesCommand.UpdateEmployerProfile(userId, employerProfile);
                    }
                    break;

                case MemberProfile:
                    var memberProfile = property.PropertyValue as MemberProfile;
                    if (memberProfile != null)
                    {
                        _profilesCommand.UpdateMemberProfile(userId, memberProfile);
                    }
                    break;
                }
            }
        }