예제 #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);
        }
예제 #2
0
파일: SeoTests.cs 프로젝트: formist/LinkMe
        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");
        }
예제 #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);
        }
예제 #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()
            }));
        }
예제 #5
0
 public static ReadOnlyUrl GetCommunityPathUrl(this IVerticalsCommand verticalsCommand, Community community, string path)
 {
     return(verticalsCommand.GetVertical(community).GetVerticalPathUrl(path));
 }
예제 #6
0
 public static ReadOnlyUrl GetCommunityHostUrl(this IVerticalsCommand verticalsCommand, Community community, bool secure, string path)
 {
     return(verticalsCommand.GetVertical(community).GetVerticalHostUrl(secure, path));
 }
예제 #7
0
 public static Vertical GetVertical(this IVerticalsCommand verticalsCommand, Community community)
 {
     return(verticalsCommand.GetVertical(community.Id));
 }
예제 #8
0
        private Vertical CreateVertical()
        {
            var community = TestCommunity.LiveInAustralia.CreateTestCommunity(_communitiesCommand, _verticalsCommand, _contentEngine);

            return(_verticalsCommand.GetVertical(community));
        }