예제 #1
0
        public async Task GetMatchListByAccountIdAsyncTest_WithFilters()
        {
            IRiotClient             client       = new RiotClient();
            IEnumerable <long>      championIds  = new[] { 143L, 412L }; // Zyra, Thresh
            IEnumerable <QueueType> rankedQueues = new[] { QueueType.RANKED_FLEX_SR, QueueType.TEAM_BUILDER_RANKED_SOLO };
            IEnumerable <Season>    seasons      = new[] { Season.PRESEASON2017, Season.SEASON2017 };
            MatchList matchList = await client.GetMatchListByAccountIdAsync(48555045L, championIds, rankedQueues, seasons);

            Assert.That(matchList, Is.Not.Null);
            Assert.That(matchList.Matches, Is.Not.Null.And.Not.Empty);
            Assert.That(matchList.Matches.All(m => championIds.Contains(m.Champion)), "Unexpected Champion ID: " + matchList.Matches.FirstOrDefault(m => !championIds.Contains(m.Champion))?.Champion);
            Assert.That(matchList.Matches.All(m => rankedQueues.Contains(m.Queue)), "Unexpected Queue ID: " + matchList.Matches.FirstOrDefault(m => !rankedQueues.Contains(m.Queue))?.Queue);
            Assert.That(matchList.Matches.All(m => seasons.Contains(m.Season)), "Unexpected Season ID: " + matchList.Matches.FirstOrDefault(m => !seasons.Contains(m.Season))?.Season);

            foreach (var id in championIds)
            {
                Assert.That(matchList.Matches.Any(m => m.Champion == id), "Champion ID not found: " + id);
            }
            foreach (var id in rankedQueues)
            {
                Assert.That(matchList.Matches.Any(m => m.Queue == id), "Queue ID not found: " + id);
            }
            foreach (var id in seasons.Except(new[] { Season.SEASON2016 }))
            {
                Assert.That(matchList.Matches.Any(m => m.Season == id), "Season ID not found: " + id);
            }
        }
예제 #2
0
        public async Task GetMatchListByAccountIdAsyncTest_WithFilters()
        {
            IRiotClient             client       = new RiotClient();
            IEnumerable <long>      championIds  = new[] { 19L, 107L }; // Warwick, Rengar
            IEnumerable <QueueType> rankedQueues = new[] { QueueType.TEAM_BUILDER_DRAFT_UNRANKED_5x5, QueueType.TEAM_BUILDER_RANKED_SOLO };
            IEnumerable <Season>    seasons      = new[] { Season.PRESEASON2018, Season.SEASON2018 };
            MatchList matchList = await client.GetMatchListByAccountIdAsync(encryptedAccountId, championIds, rankedQueues, seasons);

            Assert.That(matchList, Is.Not.Null);
            Assert.That(matchList.Matches, Is.Not.Null.And.Not.Empty);
            Assert.That(matchList.Matches.All(m => championIds.Contains(m.Champion)), "Unexpected Champion ID: " + matchList.Matches.FirstOrDefault(m => !championIds.Contains(m.Champion))?.Champion);
            Assert.That(matchList.Matches.All(m => rankedQueues.Contains(m.Queue)), "Unexpected Queue ID: " + matchList.Matches.FirstOrDefault(m => !rankedQueues.Contains(m.Queue))?.Queue);
            Assert.That(matchList.Matches.All(m => seasons.Contains(m.Season)), "Unexpected Season ID: " + matchList.Matches.FirstOrDefault(m => !seasons.Contains(m.Season))?.Season);

            foreach (var id in championIds)
            {
                Assert.That(matchList.Matches.Any(m => m.Champion == id), "Champion ID not found: " + id);
            }
            foreach (var id in rankedQueues)
            {
                Assert.That(matchList.Matches.Any(m => m.Queue == id), "Queue ID not found: " + id);
            }
            foreach (var id in seasons.Except(new[] { Season.PRESEASON2018 }))
            {
                Assert.That(matchList.Matches.Any(m => m.Season == id), "Season ID not found: " + id);
            }
        }
예제 #3
0
        public async Task GetMatchListByAccountIdAsyncTest_WithDateFilters()
        {
            IRiotClient client    = new RiotClient();
            var         beginTime = new DateTime(2015, 6, 1, 0, 0, 0, DateTimeKind.Utc);
            var         endTime   = new DateTime(2015, 6, 7, 0, 0, 0, DateTimeKind.Utc);
            var         matchList = await client.GetMatchListByAccountIdAsync(48555045L, beginTime : beginTime, endTime : endTime);

            Assert.That(matchList, Is.Not.Null);
            Assert.That(matchList.Matches, Is.Not.Null.And.Not.Empty);
            for (var i = 0; i < matchList.Matches.Count; ++i)
            {
                Assert.That(matchList.Matches[i].Timestamp, Is.GreaterThanOrEqualTo(beginTime), $"Match {i} was before the begin time.");
                Assert.That(matchList.Matches[i].Timestamp, Is.LessThanOrEqualTo(endTime), $"Match {i} was after the end time.");
            }
        }
예제 #4
0
        public async Task GetMatchListByAccountIdAsyncTest()
        {
            IRiotClient client    = new RiotClient();
            MatchList   matchList = await client.GetMatchListByAccountIdAsync(48555045L, beginIndex : 1, endIndex : 3);

            Assert.That(matchList, Is.Not.Null);
            Assert.That(matchList.Matches, Is.Not.Null.And.Not.Empty);
            var match = matchList.Matches.First();

            Assert.That(match.GameId, Is.GreaterThan(0));
            Assert.That(match.PlatformId, Is.EqualTo(client.PlatformId));

            Assert.That(matchList.StartIndex, Is.EqualTo(1));
            Assert.That(matchList.EndIndex, Is.EqualTo(3));
            Assert.That(matchList.TotalGames, Is.GreaterThan(0));
        }