public void InvalidApiInterface_RequestFails()
        {
            var response = DotaApiClient.GetLeaderboardAsync(apiInterface: "IDota_2_Leaderboards")
                           .Result;

            SleepAfterSendingRequest();

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

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void ValidRegion_ReturnsCorrectRegionLeaderboard(DotaRegion region)
        {
            var response = DotaApiClient.GetLeaderboardAsync(region)
                           .Result;

            SleepAfterSendingRequest();

            AssertRequestWasSuccessful(response);
            Assert.NotNull(response.Contents);
            Assert.NotEmpty(response.Contents.Players);
        }
        public async Task MethodGotCancelled_RequestFails()
        {
            CancellationTokenSource source = new CancellationTokenSource();

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

            // Cancel method
            source.Cancel();

            var response = await task;

            SleepAfterSendingRequest();

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