Exemplo n.º 1
0
 public void Leave(Club club)
 {
     if (memberIn.Contains(club))
     {
         memberIn.Remove(club);
         club.RemoveMember(this);
     }
 }
Exemplo n.º 2
0
        public void RemoveMember()
        {
            var p1      = new Person("test", "test", USA);
            var p2      = new Person("test", "test", USA);
            var theClub = new Club();

            theClub.AddMember(p1);
            theClub.AddMember(p2);
            theClub.RemoveMember(p1);

            assertIsConsistent(p2, theClub);
            Assert.AreEqual(0, p1.MemberOf.Count());
            Assert.AreEqual(1, theClub.Members.Count());
        }