Пример #1
0
 private StatCollectionHandler(ILogger l, string apiKey, long pastTarget)
 {
     this.logger      = l;
     this.qProcessing = new ConcurrentQueue <Daedalus.GetMatchDetails.Match>();
     this.apiClient   = new DotaApiClient(apiKey);
     this.past_target = pastTarget;
 }
Пример #2
0
        public void GetTopLiveEventGames_DefaultParams_ReturnsTopLiveEventGames()
        {
            var topEventGames = DotaApiClient.GetTopLiveEventGamesAsync()
                                .Result;

            Assert.NotNull(topEventGames);
            Assert.NotEmpty(topEventGames);
        }
Пример #3
0
        public void DefaultParams_ReturnsTI_Prizepool()
        {
            var response = DotaApiClient.GetInternationalPrizePoolAsync()
                           .Result;

            AssertRequestWasSuccessful(response);
            Assert.True(response.Contents != 0);
        }
        public async Task NotEmpty()
        {
            using (var client = new DotaApiClient(this.ApiKey))
            {
                var leagues = await client.GetLeagueListing();

                Assert.NotEmpty(leagues);
            }
        }
Пример #5
0
        public async Task NotNull()
        {
            using (var client = new DotaApiClient(this.ApiKey))
            {
                var matchDetails = await client.GetMatchDetails(1962101529);

                Assert.NotNull(matchDetails);
            }
        }
        public void ItemIdWithNoCreatorsProvided_ReturnsEmptyCreators(uint itemDef)
        {
            var response = DotaApiClient.GetItemCreatorsAsync(itemDef).Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
Пример #7
0
        public void GetTopLiveGames_DefaultParams_ReturnsTopLiveGames()
        {
            var topGames = DotaApiClient.GetTopLiveGamesAsync()
                           .Result;

            SleepAfterSendingRequest();

            Assert.NotEmpty(topGames.Contents);
        }
Пример #8
0
		public async Task NotNull()
		{
			using (var client = new DotaApiClient(this.ApiKey))
			{
				var matchDetails = await client.GetMatchDetails(1962101529);

				Assert.NotNull(matchDetails);
			}
		}
		public async Task Null()
		{
			using (var client = new DotaApiClient(this.ApiKey))
			{
				var profile = await client.GetPlayerSummaries(1234);
				
				Assert.Null(profile);
			}
		}
        public async Task Null()
        {
            using (var client = new DotaApiClient(this.ApiKey))
            {
                var team = await client.GetTeamInfoByTeamID(long.MaxValue);

                Assert.Null(team);
            }
        }
		public async Task NotNull()
		{
			using (var client = new DotaApiClient(this.ApiKey))
			{
				var profile = await client.GetPlayerSummaries(76561197973295540);

				Assert.NotNull(profile);
			}
		}
Пример #12
0
        public async Task NotEmpty_HeroId()
        {
            using (var client = new DotaApiClient(this.ApiKey))
            {
                var matches = await client.GetMatchHistory(76561197973295540, 1);

                Assert.NotEmpty(matches);
            }
        }
Пример #13
0
 public void ArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() =>
     {
         using (var client = new DotaApiClient(null))
         {
         }
     });
 }
        public void GetEquipedPlayerItems_PrivateAccount_Returns()
        {
            var response = DotaApiClient.GetEquipedPlayerItemsAsync(76561198059119066, 1).Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public async Task NotNull()
        {
            using (var client = new DotaApiClient(this.ApiKey))
            {
                var team = await client.GetTeamInfoByTeamID(2013239);

                Assert.NotNull(team);
            }
        }
        public async Task NotNull()
        {
            using (var client = new DotaApiClient(this.ApiKey))
            {
                var profile = await client.GetPlayerSummaries(76561197973295540);

                Assert.NotNull(profile);
            }
        }
		public async Task NotEmpty()
		{
			using (var client = new DotaApiClient(this.ApiKey))
			{
				var leagues = await client.GetLiveLeagueGames();

				Assert.NotEmpty(leagues);
			}
		}
Пример #18
0
        public void DefaultParams_ReturnsLeagueListing()
        {
            var response = DotaApiClient.GetLeagueListingAsync()
                           .Result;

            AssertRequestWasSuccessful(response);
            Assert.NotNull(response.Contents);
            Assert.NotEmpty(response.Contents);
        }
		public async Task Null()
		{
			using (var client = new DotaApiClient(this.ApiKey))
			{
				var team = await client.GetTeamInfoByTeamID(long.MaxValue);

				Assert.Null(team);
			}
		}
Пример #20
0
		public async Task NotEmpty_HeroId()
		{
			using (var client = new DotaApiClient(this.ApiKey))
			{
				var matches = await client.GetMatchHistory(76561197973295540, 1);

				Assert.NotEmpty(matches);
			}
		}
Пример #21
0
 public void ArgumentNullException()
 {
     Assert.Throws<ArgumentNullException>(() =>
     {
         using (var client = new DotaApiClient(null))
         {
         }
     });
 }
		public async Task NotNull()
		{
			using (var client = new DotaApiClient(this.ApiKey))
			{
				var team = await client.GetTeamInfoByTeamID(2013239);

				Assert.NotNull(team);
			}
		}
        public async Task Null()
        {
            using (var client = new DotaApiClient(this.ApiKey))
            {
                var profile = await client.GetPlayerSummaries(1234);

                Assert.Null(profile);
            }
        }
        public void InvalidMethodVersion_RequestFails()
        {
            var response = DotaApiClient.GetMatchHistoryBySequenceNumAsync(5215439388, version: "v393")
                           .Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void InvalidApiInterface_RequestFails()
        {
            var response = DotaApiClient.GetTournamentPrizePoolAsync(11517,
                                                                     apiInterface: "IProDota").Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void InvalidMethodVersion_RequestFails()
        {
            var response = DotaApiClient.GetTournamentPrizePoolAsync(11517,
                                                                     version: "v2.3").Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void InvalidMethodVersion_RequestFails()
        {
            var response = DotaApiClient.GetRecentDcpEventsAsync(version: "v1.2.3")
                           .Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
Пример #28
0
		public async Task ArgumentOutOfRangeException()
		{
			await Assert.ThrowsAsync<ArgumentOutOfRangeException>(async () =>
			{
				using (var client = new DotaApiClient(this.ApiKey))
				{
					var matchDetails = await client.GetMatchDetails(0);
				}
			});
		}
Пример #29
0
        public void InvalidApiInterface_RequestFails()
        {
            var response = DotaApiClient.GetPlayerItemsAsync(76561198107435620,
                                                             apiInterface: "IDota_2_Cosmetics").Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void InvalidApiInterface_RequestFails()
        {
            var response = DotaApiClient.GetDotaTeamInfosByIdAsync(apiInterface: "IProDota")
                           .Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
Пример #31
0
        public void InvalidMethodVersion_RequestFails()
        {
            var response = DotaApiClient.GetPlayerItemsAsync(76561198107435620,
                                                             version: "v8.3").Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void RandomMethodVersion_RequestFails()
        {
            var response = DotaApiClient.GetPlayerProfileAsync(99765000,
                                                               version: "v1.99").Result;

            SleepAfterSendingRequest();

            AssertRequestWasSuccessful(response);
            Assert.NotNull(response.Contents);
        }
        public void InvalidApiInterface_RequestFails()
        {
            var response = DotaApiClient.GetTournamentPlayerStatsAsync(72312627,
                                                                       9870, apiInterface: "IProDota").Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void InvalidApiInterface_RequestFails()
        {
            var response = DotaApiClient.GetPlayerProfileAsync(99765000,
                                                               apiInterface: "IDota_2_Players").Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void InvalidMethodVersion_RequestFails()
        {
            var response = DotaApiClient.GetTournamentPlayerStatsAsync(72312627,
                                                                       9870, version: "v1.3").Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void NonProId_ReturnsEmptyObject()
        {
            var response = DotaApiClient.GetTournamentPlayerStatsAsync(147169892, 9870)
                           .Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
Пример #37
0
        public void InvalidMethodVersion_RequestFails()
        {
            var response = DotaApiClient.GetItemIconPathAsync("infinite_waves_shoulder",
                                                              version: "v1.2.3").Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
Пример #38
0
        public void ItemDefAndInvalidTypeProvided_ThrowsException()
        {
            var response = DotaApiClient.GetItemIconPathAsync("dark_artistry_hair_model",
                                                              iconType: 2).Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void InvalidApiInterface_RequestFails()
        {
            var response = DotaApiClient.GetItemsAsync(apiInterface: "IDota_2_Items")
                           .Result;

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
Пример #40
0
		public async Task ArgumentOutOfRangeException_AccountId()
		{
			await Assert.ThrowsAsync<ArgumentOutOfRangeException>(async () =>
			{
				using (var client = new DotaApiClient(this.ApiKey))
				{
					var matches = await client.GetMatchHistory(0);
				}
			});
			
		}
Пример #41
0
		public async Task ArgumentOutOfRangeException_HeroId_High()
		{
			await Assert.ThrowsAsync<ArgumentOutOfRangeException>(async () =>
			{
				using (var client = new DotaApiClient(this.ApiKey))
				{
					var matches = await client.GetMatchHistory(76561197973295540, 150);
				}
			});

		}
		public async Task VerifyProfile()
		{
			using (var client = new DotaApiClient(this.ApiKey))
			{
				var profile = await client.GetPlayerSummaries(76561197973295540);

				Assert.NotNull(profile);
				Assert.Equal(76561197973295540, profile.steamid);
				Assert.Equal("RGBKnights", profile.personaname);
				Assert.Equal("http://steamcommunity.com/id/RGBKnights/", profile.profileurl);
				Assert.Equal("https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/74/746e33fac2bc741beffd5cc2b77f13f136e1e00a.jpg", profile.avatar);
			}
		}
		public async Task VerifyTeam()
		{
			using (var client = new DotaApiClient(this.ApiKey))
			{
				var team = await client.GetTeamInfoByTeamID(2013239);

				Assert.NotNull(team);
				Assert.Equal(2013239, team.team_id);
				Assert.Equal("ca", team.country_code);
				Assert.Equal(539633534871532086, team.logo);
				Assert.Equal(539633534871534771, team.logo_sponsor);
				Assert.Equal("Dev5", team.name);
				Assert.Equal("inactive", team.rating);
				Assert.Equal("Dev5", team.tag);
				Assert.Equal("www.abilitydrafter.com", team.url);
			}
		}