Exemplo n.º 1
0
 public void LadderTierAddMatches()
 {
     var lt = new LadderTier();
     var matchCounter = 0;
     var teamAID = 3;
     var teamBID = 2;
     lt.AddTeam(3,matchCounter++);
     lt.AddTeam(2,matchCounter++);
     var matches = lt.GetAllUnplayedMatches();
     foreach(var match in matches.Values)
     {
         Assert.AreEqual(teamAID, match.GetTeamAID());
         Assert.AreEqual(teamBID, match.GetTeamBID());
     }
 }
Exemplo n.º 2
0
 public void LadderTierUnplayedMatches()
 {
     var lt = new LadderTier();
     var totalTeams = 16;
     var teamIDs = GetTeamIDs(totalTeams);
     lt.GenerateRandomMatches(teamIDs);
     var matches = lt.GetAllMatches();
     var scoreA = new Score();
     scoreA.AddFlag();
     var scoreB = new Score();
     scoreB.AddTag();
     int i = 0;
     foreach (var match in matches)
     {
         if (i == 4)
         {
             break;
         }
         var key = match.Key;
         var value = match.Value;
         var teamAID = match.Value.GetTeamAID();
         value.SetTeamAScore(scoreA);
         value.SetTeamBScore(scoreB);
         lt.SetMatch(key, value);
         Assert.AreEqual(teamAID, lt.GetWinner(key));
         i++;
     }
     var played = lt.GetAllUnplayedMatches();
     Assert.AreEqual(4, played.Count);
 }