public void MulitpleClubs() { var p1 = new Person("test", "test", USA); var p2 = new Person("test", "test", USA); var club1 = new Club(); var club2 = new Club(); p1.Join(club1); p1.Join(club2); club1.AddMember(p2); club2.AddMember(p2); assertIsConsistent(p1, club1); assertIsConsistent(p1, club2); assertIsConsistent(p2, club1); assertIsConsistent(p1, club2); }
public void JoinClub() { var p = new Person("test", "test", USA); var theClub = new Club(); p.Join(theClub); assertIsConsistent(p, theClub); }
public void MulitpleClubs() { var p1 = new Person("test", "test", USA); var p2 = new Person("test", "test", USA); var club1 = new Club(); var club2 = new Club(); p1.Join(club1); p1.Join(club2); club1.AddMember(p2); club2.AddMember(p2); assertIsConsistent(p1, club1); assertIsConsistent(p1, club2); assertIsConsistent(p2, club1); assertIsConsistent(p1, club2); }
public void AddMember(Person person) { if (!members.Contains(person)) { members.Add(person); person.Join(this); } }
public void JoinClub() { var p = new Person("test", "test", USA); var theClub = new Club(); p.Join(theClub); assertIsConsistent(p, theClub); }