コード例 #1
0
        public async Task GetChampionMasteriesAsyncTest()
        {
            IRiotClient client            = new RiotClient();
            var         championMasteries = await client.GetChampionMasteriesAsync(34172230L);

            Assert.That(championMasteries, Is.Not.Null.And.Not.Empty);
            foreach (var championMastery in championMasteries)
            {
                Assert.That(championMastery, Is.Not.Null);
                Assert.That(championMastery.ChampionId, Is.AtLeast(1), "Invalid champion ID.");
                Assert.That(championMastery.LastPlayTime, Is.GreaterThan(new DateTime(2015, 1, 1, 0, 0, 0, DateTimeKind.Utc)).And.LessThanOrEqualTo(DateTime.UtcNow));
                Assert.That(championMastery.ChampionLevel, Is.AtLeast(1), "Invalid champion level (champion ID: " + championMastery.ChampionId + ".");
                Assert.That(championMastery.ChampionPoints, Is.AtLeast(1), "Invalid number of champion points (champion ID: " + championMastery.ChampionId + ".");
                Assert.That(championMastery.PlayerId, Is.EqualTo(34172230L));
            }
        }
コード例 #2
0
ファイル: ChampionMasteryTests.cs プロジェクト: aj-r/RiotNet
        public async Task GetChampionMasteriesAsyncTest()
        {
            IRiotClient client = new RiotClient();
            var championMasteries = await client.GetChampionMasteriesAsync(34172230L);

            Assert.That(championMasteries, Is.Not.Null.And.Not.Empty);
            foreach (var championMastery in championMasteries)
            {
                Assert.That(championMastery, Is.Not.Null);
                Assert.That(championMastery.ChampionId, Is.AtLeast(1), "Invalid champion ID.");
                Assert.That(championMastery.LastPlayTime, Is.GreaterThan(new DateTime(2015, 1, 1, 0, 0, 0, DateTimeKind.Utc)).And.LessThanOrEqualTo(DateTime.UtcNow));
                Assert.That(championMastery.ChampionLevel, Is.AtLeast(1), "Invalid champion level (champion ID: " + championMastery.ChampionId + ".");
                Assert.That(championMastery.ChampionPoints, Is.AtLeast(1), "Invalid number of champion points (champion ID: " + championMastery.ChampionId + ".");
                Assert.That(championMastery.PlayerId, Is.EqualTo(34172230L));
            }
        }