Ejemplo n.º 1
0
        /// <exception cref="InvalidParameterException"/>
        /// <exception cref="SeedNotFoundException"/>
        public async Task <RoundRobinSchedule> GenerateSchedule(int roundCount, int participantCount)
        {
            ValidateRoundCount(roundCount);
            ValidateParticipantCount(participantCount);
            ValidateRelativeParticipantCount(roundCount, participantCount);

            IEnumerable <List <int> > seed = await _cyclicSeedGenerator.GenerateSeed(roundCount, participantCount / 4);

            IEnumerable <RoundRobinRound> rounds = seed.Select((p, i) => RoundFromSeed(p, participantCount / 4, i));

            return(new RoundRobinSchedule
            {
                Rounds = rounds.ToList()
            });
        }
Ejemplo n.º 2
0
        public async Task GenerateSeedShouldGenerateFourTuples(int count, int modulus)
        {
            IEnumerable <List <int> > results = await _cyclicSeedGenerator.GenerateSeed(count, modulus);

            results.Should().OnlyContain(r => r.Count == 4);
        }