Exemplo n.º 1
0
        public override CompetitorRanks GenerateResult(int tournamentRunSequence, MatchStrategy matchStrategy, List<Competitor> competitors)
        {
            TournamentRoundStrategy tournamentRoundStrategy = new KoSfFiTRS(_winsToClinchMatch);

            TournamentRound tournamentRound = new TournamentRound(tournamentRoundStrategy, matchStrategy);
            
            return tournamentRound.Run(competitors);
        }
        public void GetTournamentRoundRanksTest()
        {
            KoSfFiTRS target = new KoSfFiTRS(2);

            MatchStrategy matchStrategy = new NonRandomMs();
            List<Competitor> competitors = Helpers.CompetitorListHelper.GetStandardCompetitors(8);

            CompetitorRanks ranks = target.GenerateResult(matchStrategy, competitors);

            Assert.AreEqual(1, ranks[competitors[0]]);
            Assert.AreEqual(2, ranks[competitors[1]]);
            Assert.AreEqual(3, ranks[competitors[2]]);
            Assert.AreEqual(3, ranks[competitors[3]]);
            Assert.AreEqual(5, ranks[competitors[4]]);
            Assert.AreEqual(5, ranks[competitors[5]]);
            Assert.AreEqual(5, ranks[competitors[6]]);
            Assert.AreEqual(5, ranks[competitors[7]]);
        }