Esempio n. 1
0
        private void TestToMember(CommunityTestData fromData, bool isFromDeleted, CommunityTestData toData, bool isToDeleted, string expectedSnippet, string expectedHeaderSnippet)
        {
            var inviter = CreateInviter(fromData, isFromDeleted);

            // Invite member.

            var invitee = _memberAccountsCommand.CreateTestMember(1);

            if (toData != null)
            {
                var community = toData.CreateTestCommunity(_communitiesCommand, _verticalsCommand, _contentEngine);

                if (isToDeleted)
                {
                    var vertical = _verticalsCommand.GetVertical(community);
                    vertical.IsDeleted = true;
                    _verticalsCommand.UpdateVertical(vertical);
                }

                _memberAffiliationsCommand.SetAffiliation(invitee.Id, community.Id);
            }

            var invitation = new FriendInvitation {
                InviterId = inviter.Id, InviteeId = invitee.Id
            };

            _memberFriendsCommand.SendInvitation(invitation);

            // Check.

            var email = _emailServer.AssertEmailSent();

            email.AssertAddresses(inviter, Return, invitee);
            AssertEmail(email, expectedSnippet, expectedHeaderSnippet);
        }
Esempio n. 2
0
        public void TestVerticalCanonicalLink()
        {
            var community = TestCommunity.Gta.CreateTestCommunity(_communitiesCommand, _verticalsCommand, _contentEngine);
            var vertical  = _verticalsCommand.GetVertical(community);

            TestCanonicalLink(vertical, "");
            TestCanonicalLink(vertical, "jobs");
            TestCanonicalLink(vertical, "guests/Friends.aspx");
            TestCanonicalLink(vertical, "members/resources");
        }
Esempio n. 3
0
        private Vertical GetVertical(Guid?affiliateId)
        {
            if (affiliateId == null)
            {
                return(null);
            }

            var vertical = _verticalsCommand.GetVertical(affiliateId.Value);

            if (vertical == null)
            {
                return(null);
            }

            return(vertical.IsDeleted ? null : vertical);
        }
Esempio n. 4
0
        public ActionResult Edit(Guid id)
        {
            var community = _communitiesQuery.GetCommunity(id);

            if (community == null)
            {
                return(NotFound("community", "id", id));
            }

            var vertical = _verticalsCommand.GetVertical(id);

            if (vertical == null)
            {
                return(NotFound("vertical", "id", id));
            }

            return(View(new CommunityModel
            {
                Community = community,
                Vertical = vertical,
                Countries = _locationQuery.GetCountries()
            }));
        }
Esempio n. 5
0
 public static ReadOnlyUrl GetCommunityPathUrl(this IVerticalsCommand verticalsCommand, Community community, string path)
 {
     return(verticalsCommand.GetVertical(community).GetVerticalPathUrl(path));
 }
Esempio n. 6
0
 public static ReadOnlyUrl GetCommunityHostUrl(this IVerticalsCommand verticalsCommand, Community community, bool secure, string path)
 {
     return(verticalsCommand.GetVertical(community).GetVerticalHostUrl(secure, path));
 }
Esempio n. 7
0
 public static Vertical GetVertical(this IVerticalsCommand verticalsCommand, Community community)
 {
     return(verticalsCommand.GetVertical(community.Id));
 }
Esempio n. 8
0
        private Vertical CreateVertical()
        {
            var community = TestCommunity.LiveInAustralia.CreateTestCommunity(_communitiesCommand, _verticalsCommand, _contentEngine);

            return(_verticalsCommand.GetVertical(community));
        }