private RankingEntry EntryFromClub(Club c) { foreach (RankingEntry entry in entries) if (entry.Club == c) return entry; return null; }
public Ranking(PointSystem system, Club[] clubs) { this.system = system; this.entries = new RankingEntry[clubs.Length]; for (int i = 0; i < clubs.Length; i++) this.entries[i] = new RankingEntry(clubs[i], system.InitialPoints); }
public Match(Club home, Club away, int homeGoal, int awayGoal) { this.home=home; this.away=away; this.homeGoal=homeGoal; this.awayGoal=awayGoal; }
public void IsAwayForfaitTest() { Club home = new Club("France"); Club away = new Club("Allemagne"); int homeGoal = 3; int awayGoal = -1; Match match = new Match(home, away, homeGoal, awayGoal); Assert.IsTrue(match.IsAwayForfait); }
public void HomeTest() { Club home = new Club("France"); Club away = new Club("Allemagne"); int homeGoal = 3; int awayGoal = 3; Match match = new Match(home, away, homeGoal, awayGoal); Assert.IsNotNull(home); }
public void MatchConstructorTest() { Club home = new Club("France"); Club away = new Club("Allemagne"); int homeGoal = 0; int awayGoal = 0; Match match = new Match(home,away,homeGoal,awayGoal); Assert.IsNotNull(match); }
public RankingEntry(Club club, PointSystem.ITotal points) { this.club = club; this.points = points; }
public PointSystem.ITotal GetPoints(Club club) { return EntryFromClub(club).Points; }
public void ClubConstructorTest() { String name = "OM"; Club clubname = new Club(name); Assert.IsNotNull(clubname); }