示例#1
0
        public async Task GetSpec_Test()
        {
            uint               id     = 71;
            string             query  = $"data/wow/playable-specialization/{id}";
            SpecializationJson result = await Api.GetAsync <SpecializationJson>(query, Namespace.Static).ConfigureAwait(false);

            MediaJson media = await Api.GetAsync <MediaJson>($"data/wow/media/playable-specialization/{id}", Namespace.Static).ConfigureAwait(false);

            Assert.Equal(HttpStatusCode.OK, result.ResultCode);
            Assert.True(result.DirectlyCalled);
            Assert.Equal(id, result.Id);
            Assert.Equal(HttpStatusCode.OK, media.ResultCode);
            Assert.True(media.DirectlyCalled);
            Assert.NotEmpty(media.Assets);
            Assert.NotNull(media.Assets.Find(x => x.Key == "icon").Key);
        }
示例#2
0
        public async Task GetAchievement_Test()
        {
            uint            id     = 7380;
            string          query  = $"data/wow/achievement/{id}";
            AchievementJson result = await Api.GetAsync <AchievementJson>(query, Namespace.Static).ConfigureAwait(false);

            MediaJson media = await Api.GetAsync <MediaJson>($"data/wow/media/achievement/{id}", Namespace.Static).ConfigureAwait(false);

            Assert.Equal(HttpStatusCode.OK, result.ResultCode);
            Assert.True(result.DirectlyCalled);
            Assert.Equal(id, result.Id);
            Assert.Equal(HttpStatusCode.OK, media.ResultCode);
            Assert.True(media.DirectlyCalled);
            Assert.NotEmpty(media.Assets);
            Assert.NotNull(media.Assets.Find(x => x.Key == "icon").Key);
        }