Exemplo n.º 1
0
        /// <summary>
        /// Reset a tournament, clearing all of its scores and attachments. 
        /// You can then add/remove/edit participants before starting the tournament again (tournaments/start).
        /// 
        /// Discovery:
        ///     It does not clear for participants.
        /// </summary>
        /// <returns></returns>
        public Tournament TournamentReset(Tournament tournament, TournamentResetParameters parameters = null)
        {
            string url = string.Format("tournaments/{0}/reset", this.TournamentIdentifier(tournament));
            var param = new Dictionary<string, dynamic>();
            if (parameters != null)
            {
                param = parameters.ToDictionary();
            }

            var json = this.MakeJsonRequest(url, WebRequestMethods.Http.Post, param);

            return Deserializer.Tournament(json);
        }
Exemplo n.º 2
0
        public void ResetOganizationOptionalParameters()
        {
            var name = "TournamentTest" + Utilities.RandomName();

            var parameter = new TournamentCreateParameters { Subdomain = this.subdomain };
            this.tournament = this.target.TournamentCreate(name, TournamentType.DoubleElimination, name, parameter);

            var participant1 = this.target.ParticipantCreate(this.tournament, new ParticipantCreateParameters { Name = Utilities.RandomName() });
            var participant2 = this.target.ParticipantCreate(this.tournament, new ParticipantCreateParameters { Name = Utilities.RandomName() });

            this.target.TournamentStart(this.tournament);

            var resetParameters = new TournamentResetParameters { IncludeParticipants = true };
            var tourReset = this.target.TournamentReset(this.tournament, resetParameters);

            Assert.IsNotNull(tourReset.Participants);
            Assert.AreEqual(2, tourReset.Participants.Count);
        }