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

            SleepAfterSendingRequest();

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

            SleepAfterSendingRequest();

            AssertRequestFailed(response);
            Assert.Null(response.Contents);
        }
        public void ItemIdWithCreatorsProvided_ReturnsItemCreators(uint itemDef)
        {
            var response = DotaApiClient.GetItemCreatorsAsync(itemDef).Result;

            SleepAfterSendingRequest();

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

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

            // Cancel method
            source.Cancel();

            var response = await task;

            SleepAfterSendingRequest();

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