public void RemoveMember(Person person) { if (members.Contains(person)) { members.Remove(person); person.Leave(this); } }
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()); }