示例#1
0
        public void Tournament_BuildsRoundsSeeded()
        {
            var players = new List <Player>
            {
                new Player("A")
                {
                    Seed = 1
                },
                new Player("B")
                {
                    Seed = 2
                },
                new Player("C")
                {
                    Seed = 3
                },
                new Player("D")
                {
                    Seed = 4
                }
            };
            var tournament = new Tournament {
                Players = players
            };
            var swiss  = new Swiss();
            var rounds = swiss.BuildRounds(tournament, Enumerable.Empty <Round>(), tournament.RoundCount);

            rounds.Should().NotBeEmpty();
        }
示例#2
0
        public void Standing_GetsPlayerRanking()
        {
            var players = new List <Player>
            {
                new Player("A"),
                new Player("B"),
                new Player("C"),
                new Player("D")
            };
            var tournament = new Tournament {
                Players = players
            };
            var swiss  = new Swiss();
            var rounds = swiss.BuildRounds(tournament, Enumerable.Empty <Round>(), tournament.RoundCount);

            rounds.Should().NotBeEmpty();
            tournament.Should().NotBeNull();
            foreach (var round in rounds)
            {
                foreach (var match in round.Matches)
                {
                    match.Winner = Winner.Player1;
                    match.Score();
                }
            }
            var standings = tournament.CurrentStandings();

            standings.Should().NotBeEmpty();
        }