예제 #1
0
        public void TestRemoveRepresentative()
        {
            var       member = _memberAccountsCommand.CreateTestMember(0);
            Member    friend;
            Candidate candidate;
            Resume    resume;

            CreateFriend(member.Id, out friend, out candidate, out resume);
            _representativesCommand.CreateRepresentative(member.Id, friend.Id);
            Assert.IsNotNull(_representativesQuery.GetRepresentativeId(member.Id));

            // Log in.

            LogIn(member);
            GetPage <ViewFriend>(ViewFriend.FriendIdParameter, friend.Id.ToString());

            // Check text is visible and delete.

            AssertPageContains(friend.FirstName + " is my nominated representative.");
            _btnRemoveRepresentative.Click();

            AssertPage <ViewFriend>();
            AssertPageDoesNotContain(friend.FirstName + " is my nominated representative.");
            Assert.IsFalse(_lnkRemoveRepresentative.IsVisible);
            Assert.IsFalse(_btnRemoveRepresentative.IsVisible);

            Assert.IsNull(_representativesQuery.GetRepresentativeId(member.Id));
        }
예제 #2
0
 private bool GetIsRepresented(Guid memberId)
 {
     return(_representativesQuery.GetRepresentativeId(memberId) != null);
 }
예제 #3
0
 private void AssertRepresentative(Guid representeeId)
 {
     Assert.IsNull(_representativesQuery.GetRepresentativeId(representeeId));
 }