Beispiel #1
0
        public async Task GetLeagueByIdAsyncTest()
        {
            IRiotClient client = new RiotClient();
            LeagueList  league = await client.GetLeagueByIdAsync("a681d5d0-430e-11e8-a82d-c81f66cf2333");

            Assert.That(league, Is.Not.Null);
            Assert.That(league.Entries.Count, Is.GreaterThan(1));
            Assert.That(league.Name, Is.Not.Null.And.Not.Empty);
        }
Beispiel #2
0
        public async Task GetLeagueByIdAsyncTest()
        {
            IRiotClient client = new RiotClient();
            LeagueList  league = await client.GetLeagueByIdAsync("ea0e8e10-f639-11e6-b789-c81f66cf2333");

            Assert.That(league, Is.Not.Null);
            Assert.That(league.Entries.Count, Is.GreaterThan(1));
            Assert.That(league.Name, Is.Not.Null.And.Not.Empty);
        }
Beispiel #3
0
        public async Task GetMasterLeagueAsyncTest()
        {
            IRiotClient client = new RiotClient();
            LeagueList  league = await client.GetMasterLeagueAsync(RankedQueue.RANKED_SOLO_5x5);

            Assert.That(league, Is.Not.Null);
            Assert.That(league.Entries.Count, Is.GreaterThan(1));
            Assert.That(league.Name, Is.Not.Null.And.Not.Empty);
            Assert.That(league.Queue, Is.EqualTo(RankedQueue.RANKED_SOLO_5x5));
            Assert.That(league.Tier, Is.EqualTo(Tier.MASTER));
        }
        public LeagueList MasterLeagues(string queue)
        {
            string     request = requestStringHolder.League.MasterLeaguesByQueue(queue);
            string     json    = null;
            LeagueList result  = null;

            try
            {
                json = requester.Fetch(request);
                if (json == EXCEEDED_LIMIT)
                {
                    onRateLimitExceeded();
                    return(MasterLeagues(queue));
                }
                result = RiotDtoFromJson.GetLeagueList(json);
            }
            catch
            {
                Console.WriteLine("Something went wrong in MasterLeagues(queue) : Returning null.");
                return(null);
            }

            return(result);
        }