Ejemplo n.º 1
0
        public void TestRemoveRepresentee()
        {
            var       member = _memberAccountsCommand.CreateTestMember(0);
            Member    friend;
            Candidate candidate;
            Resume    resume;

            CreateFriend(member.Id, out friend, out candidate, out resume);
            _representativesCommand.CreateRepresentative(friend.Id, member.Id);

            // Log in.

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

            // Check text and link are visible.

            AssertPageContains(friend.FirstName + " is represented by me.");
            _btnRemoveRepresentative.Click();

            AssertPageDoesNotContain(friend.FirstName + " is represented by me.");
            Assert.IsFalse(_lnkRemoveRepresentative.IsVisible);
            Assert.IsFalse(_btnRemoveRepresentative.IsVisible);

            Assert.AreEqual(0, _representativesQuery.GetRepresenteeIds(member.Id).Count);
        }
Ejemplo n.º 2
0
        private void AssertRepresentees(Guid representativeId, params Guid[] expectedRepresenteesId)
        {
            var representeeIds = _representativesQuery.GetRepresenteeIds(representativeId);

            Assert.AreEqual(expectedRepresenteesId.Length, representeeIds.Count);
            Assert.AreEqual(expectedRepresenteesId.Length, expectedRepresenteesId.Distinct().Count());
            Assert.AreEqual(representeeIds.Count, representeeIds.Distinct().Count());
            foreach (var representeeId in representeeIds)
            {
                Assert.IsTrue(expectedRepresenteesId.Contains(representeeId));
            }
        }