コード例 #1
0
 private RankingEntry EntryFromClub(Club c)
 {
     foreach (RankingEntry entry in entries)
         if (entry.Club == c)
             return entry;
     return null;
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 public Match(Club home, Club away, int homeGoal, int awayGoal)
 {
     this.home=home;
     this.away=away;
     this.homeGoal=homeGoal;
     this.awayGoal=awayGoal;
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
 }
コード例 #7
0
 public RankingEntry(Club club, PointSystem.ITotal points)
 {
     this.club = club;
     this.points = points;
 }
コード例 #8
0
 public PointSystem.ITotal GetPoints(Club club)
 {
     return EntryFromClub(club).Points;
 }
コード例 #9
0
 public void ClubConstructorTest()
 {
     String name = "OM";
     Club clubname = new Club(name);
     Assert.IsNotNull(clubname);
 }