コード例 #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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: StateTests.cs プロジェクト: formist/LinkMe
        public void TestLegacyMember()
        {
            var member = _memberAccountsCommand.CreateTestMember(0);

            // No profile before logging in.

            Assert.IsNull(_profilesQuery.GetMemberProfile(member.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(member);
            AssertUrl(LoggedInMemberHomeUrl);

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

            // Get the page again.

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

            // Log out and back in again.

            LogOut();
            LogIn(member);
            AssertUrl(LoggedInMemberHomeUrl);
            AssertNoProfilePrompt();
            //AssertProfileReminder();
            AssertNoProfileReminder();
            AssertNoTermsReminder();
            AssertMemberState(/*true*/ false, 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*/ false, true, true, false, member.Id);

            // Go to the terms page.

            Get(_termsUrl);
            AssertUrl(_termsUrl);

            // Go back to the home page.

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