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 GetTournamentPrizePool_LeagueIdProvided_ReturnsCorrectPrizepool(
            uint leagueId, uint correctPrizePool)
        {
            var response = DotaApiClient.GetTournamentPrizePoolAsync(leagueId)
                           .Result;

            SleepAfterSendingRequest();

            AssertRequestWasSuccessful(response);
            Assert.NotNull(response.Contents);
            Assert.Equal(response.Contents.LeagueId, leagueId);
            Assert.Equal(response.Contents.PrizePool, correctPrizePool);
        }
        public async Task MethodGotCancelled_RequestFails()
        {
            CancellationTokenSource source = new CancellationTokenSource();

            // Start task to be cancelled
            var task = Task.Run(async() =>
            {
                return(await DotaApiClient.GetTournamentPrizePoolAsync(11517,
                                                                       cToken: source.Token));
            });

            // Cancel method
            source.Cancel();

            var response = await task;

            SleepAfterSendingRequest();

            AssertRequestWasCancelled(response);
            Assert.Null(response.Contents);
        }