示例#1
0
        public async Task UpdateTournamentCodeAsyncTest()
        {
            const string code   = "NA2198-TOURNAMENTCODE0002";
            IRiotClient  client = new RiotClient(GetTournamentSettings());

            await client.UpdateTournamentCodeAsync(code,
                                                   new List <long> {
                35870943L, 32153637L, 31220286L, 37431081L, 20934656L, 30545906L, 32550537L, 38722060L, 21204597L, 20028460L
            },
                                                   MapType.SUMMONERS_RIFT, PickType.BLIND_PICK, SpectatorType.ALL, CancellationToken.None);

            TournamentCode tournamentCode = await client.GetTournamentCodeAsync(code);

            Assert.That(tournamentCode, Is.Not.Null);
            Assert.That(tournamentCode.Map, Is.EqualTo(MapType.SUMMONERS_RIFT));
            Assert.That(tournamentCode.Participants, Contains.Item(35870943L));
            Assert.That(tournamentCode.PickType, Is.EqualTo(PickType.BLIND_PICK));
            Assert.That(tournamentCode.Spectators, Is.EqualTo(SpectatorType.ALL));

            await client.UpdateTournamentCodeAsync(code,
                                                   new List <long> {
                22811529L, 32153637L, 31220286L, 37431081L, 20934656L, 30545906L, 32550537L, 38722060L, 21204597L, 20028460L
            },
                                                   MapType.HOWLING_ABYSS, PickType.ALL_RANDOM, SpectatorType.LOBBYONLY);

            tournamentCode = await client.GetTournamentCodeAsync(code);

            Assert.That(tournamentCode, Is.Not.Null);
            Assert.That(tournamentCode.Map, Is.EqualTo(MapType.HOWLING_ABYSS));
            Assert.That(tournamentCode.Participants, Contains.Item(22811529L));
            Assert.That(tournamentCode.PickType, Is.EqualTo(PickType.ALL_RANDOM));
            Assert.That(tournamentCode.Spectators, Is.EqualTo(SpectatorType.LOBBYONLY));
        }
示例#2
0
        public async Task UpdateTournamentCodeAsyncTest()
        {
            const string code   = "NA2198-TOURNAMENTCODE0002";
            IRiotClient  client = new RiotClient(GetTournamentSettings());

            await client.UpdateTournamentCodeAsync(code,
                                                   new List <string> {
                rndmInternetManId, disqueJockeyId, denverId, choGodId, zarkraId, razardId, angry5RenegadoId, boostedTopLanerId, xaeiId, zeractleId
            },
                                                   MapType.SUMMONERS_RIFT, PickType.BLIND_PICK, SpectatorType.ALL, CancellationToken.None);

            TournamentCode tournamentCode = await client.GetTournamentCodeAsync(code);

            Assert.That(tournamentCode, Is.Not.Null);
            Assert.That(tournamentCode.Map, Is.EqualTo(MapType.SUMMONERS_RIFT));
            Assert.That(tournamentCode.Participants, Contains.Item(35870943L));
            Assert.That(tournamentCode.PickType, Is.EqualTo(PickType.BLIND_PICK));
            Assert.That(tournamentCode.Spectators, Is.EqualTo(SpectatorType.ALL));

            await client.UpdateTournamentCodeAsync(code,
                                                   new List <string> {
                goodMorningCronoId, disqueJockeyId, denverId, choGodId, zarkraId, razardId, angry5RenegadoId, boostedTopLanerId, xaeiId, zeractleId
            },
                                                   MapType.HOWLING_ABYSS, PickType.ALL_RANDOM, SpectatorType.LOBBYONLY);

            tournamentCode = await client.GetTournamentCodeAsync(code);

            Assert.That(tournamentCode, Is.Not.Null);
            Assert.That(tournamentCode.Map, Is.EqualTo(MapType.HOWLING_ABYSS));
            Assert.That(tournamentCode.Participants, Contains.Item(22811529L));
            Assert.That(tournamentCode.PickType, Is.EqualTo(PickType.ALL_RANDOM));
            Assert.That(tournamentCode.Spectators, Is.EqualTo(SpectatorType.LOBBYONLY));
        }
示例#3
0
        public async Task UpdateTournamentCodeAsyncTest_WithObject()
        {
            const string code   = "NA2198-TOURNAMENTCODE0002";
            IRiotClient  client = new RiotClient(GetTournamentSettings());

            await client.UpdateTournamentCodeAsync(new TournamentCode
            {
                Code         = code,
                Participants = new ListOfString {
                    rndmInternetManId, disqueJockeyId, denverId, choGodId, zarkraId, razardId, angry5RenegadoId, boostedTopLanerId, xaeiId, zeractleId
                },
                Map        = MapType.TWISTED_TREELINE,
                PickType   = PickType.TOURNAMENT_DRAFT,
                Spectators = SpectatorType.NONE,
            }, CancellationToken.None);

            TournamentCode tournamentCode = await client.GetTournamentCodeAsync(code);

            Assert.That(tournamentCode, Is.Not.Null);
            Assert.That(tournamentCode.Map, Is.EqualTo(MapType.TWISTED_TREELINE));
            Assert.That(tournamentCode.Participants, Contains.Item(35870943L));
            Assert.That(tournamentCode.PickType, Is.EqualTo(PickType.TOURNAMENT_DRAFT));
            Assert.That(tournamentCode.Spectators, Is.EqualTo(SpectatorType.NONE));

            await client.UpdateTournamentCodeAsync(new TournamentCode
            {
                Code         = code,
                Participants = new ListOfString {
                    goodMorningCronoId, disqueJockeyId, denverId, choGodId, zarkraId, razardId, angry5RenegadoId, boostedTopLanerId, xaeiId, zeractleId
                },
                Map        = MapType.HOWLING_ABYSS,
                PickType   = PickType.ALL_RANDOM,
                Spectators = SpectatorType.LOBBYONLY,
            });

            tournamentCode = await client.GetTournamentCodeAsync(code);

            Assert.That(tournamentCode, Is.Not.Null);
            Assert.That(tournamentCode.Map, Is.EqualTo(MapType.HOWLING_ABYSS));
            Assert.That(tournamentCode.Participants, Contains.Item(22811529L));
            Assert.That(tournamentCode.PickType, Is.EqualTo(PickType.ALL_RANDOM));
            Assert.That(tournamentCode.Spectators, Is.EqualTo(SpectatorType.LOBBYONLY));
        }
示例#4
0
        public async Task GetTournamentCodeAsyncTest()
        {
            IRiotClient    client         = new RiotClient(GetTournamentSettings());
            TournamentCode tournamentCode = await client.GetTournamentCodeAsync("NA2198-TOURNAMENTCODE0002", CancellationToken.None);

            Assert.That(tournamentCode, Is.Not.Null);
            Assert.That(tournamentCode.Id, Is.GreaterThan(0));
            Assert.That(tournamentCode.LobbyName, Is.Not.Null.And.Not.Empty);
            Assert.That(tournamentCode.Map, Is.EqualTo(MapType.HOWLING_ABYSS));
            Assert.That(tournamentCode.MetaData, Is.Not.Null.And.Not.Empty);
            Assert.That(tournamentCode.Participants, Is.Not.Null.And.Not.Empty);
            Assert.That(tournamentCode.Password, Is.Not.Null.And.Not.Empty);
            Assert.That(tournamentCode.PickType, Is.EqualTo(PickType.ALL_RANDOM));
            Assert.That(tournamentCode.ProviderId, Is.GreaterThan(0));
            Assert.That(tournamentCode.Region, Is.EqualTo("NA"));
            Assert.That(tournamentCode.Spectators, Is.EqualTo(SpectatorType.LOBBYONLY));
            Assert.That(tournamentCode.TeamSize, Is.GreaterThan(0));
            Assert.That(tournamentCode.TournamentId, Is.GreaterThan(0));
        }
示例#5
0
        public async Task UpdateTournamentCodeAsyncTest_WithObject()
        {
            const string code   = "NA2198-TOURNAMENTCODE0002";
            IRiotClient  client = new RiotClient(GetTournamentSettings());

            await client.UpdateTournamentCodeAsync(new TournamentCode
            {
                Code         = code,
                Participants = new ListOfLong {
                    35870943L, 32153637L, 31220286L, 37431081L, 20934656L, 30545906L, 32550537L, 38722060L, 21204597L, 20028460L
                },
                Map        = MapType.TWISTED_TREELINE,
                PickType   = PickType.TOURNAMENT_DRAFT,
                Spectators = SpectatorType.NONE,
            }, CancellationToken.None);

            TournamentCode tournamentCode = await client.GetTournamentCodeAsync(code);

            Assert.That(tournamentCode, Is.Not.Null);
            Assert.That(tournamentCode.Map, Is.EqualTo(MapType.TWISTED_TREELINE));
            Assert.That(tournamentCode.Participants, Contains.Item(35870943L));
            Assert.That(tournamentCode.PickType, Is.EqualTo(PickType.TOURNAMENT_DRAFT));
            Assert.That(tournamentCode.Spectators, Is.EqualTo(SpectatorType.NONE));

            await client.UpdateTournamentCodeAsync(new TournamentCode
            {
                Code         = code,
                Participants = new ListOfLong {
                    22811529L, 32153637L, 31220286L, 37431081L, 20934656L, 30545906L, 32550537L, 38722060L, 21204597L, 20028460L
                },
                Map        = MapType.HOWLING_ABYSS,
                PickType   = PickType.ALL_RANDOM,
                Spectators = SpectatorType.LOBBYONLY,
            });

            tournamentCode = await client.GetTournamentCodeAsync(code);

            Assert.That(tournamentCode, Is.Not.Null);
            Assert.That(tournamentCode.Map, Is.EqualTo(MapType.HOWLING_ABYSS));
            Assert.That(tournamentCode.Participants, Contains.Item(22811529L));
            Assert.That(tournamentCode.PickType, Is.EqualTo(PickType.ALL_RANDOM));
            Assert.That(tournamentCode.Spectators, Is.EqualTo(SpectatorType.LOBBYONLY));
        }
示例#6
0
 /// <summary>
 /// Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key.
 /// This method does NOT support the tournament stub API.
 /// </summary>
 /// <param name="tournamentCode">The tournament code to update. Only the Code, Participants, MapType, PickType, and SpectatorType properties are used.</param>
 /// <param name="token">The cancellation token to cancel the operation.</param>
 /// <returns>A task representing the asynchronous operation.</returns>
 public Task UpdateTournamentCodeAsync(TournamentCode tournamentCode, CancellationToken token)
 {
     return(UpdateTournamentCodeAsync(tournamentCode, RegionalProxy.Americas, token));
 }
示例#7
0
 /// <summary>
 /// Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key.
 /// This method does NOT support the tournament stub API.
 /// </summary>
 /// <param name="tournamentCode">The tournament code to update. Only the Code, Participants, MapType, PickType, and SpectatorType properties are used.</param>
 /// <param name="regionalProxy">The name of the regional proxy service. This should equal one of the <see cref="RegionalProxy"/> values.</param>
 /// <param name="token">The cancellation token to cancel the operation.</param>
 /// <returns>A task representing the asynchronous operation.</returns>
 public Task UpdateTournamentCodeAsync(TournamentCode tournamentCode, string regionalProxy = RegionalProxy.Americas, CancellationToken token = default(CancellationToken))
 {
     return(UpdateTournamentCodeAsync(tournamentCode.Code, tournamentCode.Participants, tournamentCode.Map, tournamentCode.PickType, tournamentCode.Spectators, regionalProxy, token));
 }
示例#8
0
 /// <summary>
 /// Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key.
 /// This method does NOT support the tournament stub API.
 /// </summary>
 /// <param name="tournamentCode">The definition for the tournament code(s) to create.</param>
 /// <param name="count">The number of codes to create (max 1000).</param>
 /// <param name="token">The cancellation token to cancel the operation.</param>
 /// <returns>A task representing the asynchronous operation.</returns>
 public Task <List <string> > CreateTournamentCodeAsync(TournamentCode tournamentCode, int?count, CancellationToken token)
 {
     return(CreateTournamentCodeAsync(tournamentCode, count, RegionalProxy.Americas, token));
 }
示例#9
0
 /// <summary>
 /// Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key.
 /// This method does NOT support the tournament stub API.
 /// </summary>
 /// <param name="tournamentCode">The definition for the tournament code(s) to create.</param>
 /// <param name="count">The number of codes to create (max 1000).</param>
 /// <param name="regionalProxy">The name of the regional proxy service. This should equal one of the <see cref="RegionalProxy"/> values.</param>
 /// <param name="token">The cancellation token to cancel the operation.</param>
 /// <returns>A task representing the asynchronous operation.</returns>
 public Task <List <string> > CreateTournamentCodeAsync(TournamentCode tournamentCode, int?count = null, string regionalProxy = RegionalProxy.Americas, CancellationToken token = default(CancellationToken))
 {
     return(CreateTournamentCodeAsync(tournamentCode.TournamentId, count, tournamentCode.Participants, tournamentCode.Map, tournamentCode.PickType, tournamentCode.Spectators,
                                      tournamentCode.TeamSize, tournamentCode.MetaData, regionalProxy, token));
 }
示例#10
0
 /// <summary>
 /// Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key.
 /// IMPORTANT: if you are using an interim API key, you must set <see cref="RiotClientSettings.UseTournamentStub"/> to true before calling this method.
 /// </summary>
 /// <param name="tournamentCode">The tournament code to update. Only the Code, Participants, MapType, PickType, and SpectatorType proerties are used.</param>
 public Task UpdateTournamentCodeAsync(TournamentCode tournamentCode)
 {
     return UpdateTournamentCodeAsync(tournamentCode.Code, tournamentCode.Participants, tournamentCode.Map, tournamentCode.PickType, tournamentCode.Spectators);
 }