示例#1
0
        public void CreateProviderAsync_CreateTournamentAsync_CreateTournamentCodeAsync_UpdateTournamentCodeAsync_Test()
        {
            var provider = api.CreateProviderAsync(region, url).Result;

            Assert.AreNotEqual(0, provider.Id);
            var tournament = api.CreateTournamentAsync(provider.Id, tournamentName).Result;

            Assert.AreNotEqual(0, tournament.Id);
            var tmpTournamentCode = api
                                    .CreateTournamentCodeAsync(tournament.Id, 1, new List <long> {
                id, id2
            }, spectatorType, pickType, mapType, string.Empty)
                                    .Result;

            Assert.AreNotEqual("", tmpTournamentCode);
            var tournamentCodes = api
                                  .CreateTournamentCodesAsync(tournament.Id, 1, spectatorType, pickType, mapType, string.Empty, 2)
                                  .Result;

            Assert.AreEqual(2, tournamentCodes.Count);
            var tournamentCodeDetails = api.GetTournamentCodeDetails(tmpTournamentCode);
            var success = api
                          .UpdateTournamentCodeAsync(tmpTournamentCode,
                                                     new List <long> {
                id, id2
            }, TournamentSpectatorType.All,
                                                     TournamentPickType.AllRandom, TournamentMapType.HowlingAbyss)
                          .Result;

            Assert.IsTrue(success);
            var tournamentCodeDetailsUpdated = api.GetTournamentCodeDetails(tmpTournamentCode);

            Assert.AreNotEqual(tournamentCodeDetails.PickType, tournamentCodeDetailsUpdated.PickType);
            Assert.AreNotEqual(tournamentCodeDetails.Map, tournamentCodeDetailsUpdated.Map);
        }