Пример #1
0
 public void RemoveMember(Person person)
 {
     if (members.Contains(person))
     {
         members.Remove(person);
         person.Leave(this);
     }
 }
Пример #2
0
        public void LeaveClub()
        {
            var p1 = new Person("test", "test", USA);
            var p2 = new Person("test", "test", USA);
            var theClub = new Club();
            theClub.AddMember(p1);
            theClub.AddMember(p2);
            p1.Leave(theClub);

            assertIsConsistent(p2, theClub);
            Assert.AreEqual(0, p1.MemberOf.Count());
            Assert.AreEqual(1, theClub.Members.Count());
        }
Пример #3
0
        public void LeaveClub()
        {
            var p1      = new Person("test", "test", USA);
            var p2      = new Person("test", "test", USA);
            var theClub = new Club();

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

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