Example #1
0
        public void DefaultParams_ReturnsTI_Prizepool()
        {
            var response = DotaApiClient.GetInternationalPrizePoolAsync()
                           .Result;

            AssertRequestWasSuccessful(response);
            Assert.True(response.Contents != 0);
        }
Example #2
0
        public async Task MethodGotCancelled_RequestFails()
        {
            CancellationTokenSource source = new CancellationTokenSource();

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

            // Cancel method
            source.Cancel();

            var response = await task;

            SleepAfterSendingRequest();

            AssertRequestWasCancelled(response);
            Assert.True(response.Contents == 0);
        }