public void InvalidApiInterface_RequestFails() { var response = DotaApiClient.GetStoreMetadataAsync(apiInterface: "IDota_2_Heroe") .Result; SleepAfterSendingRequest(); AssertRequestFailed(response); Assert.Null(response.Contents); }
public void InvalidMethodVersion_RequestFails() { var response = DotaApiClient.GetStoreMetadataAsync(version: "v1.2.3") .Result; SleepAfterSendingRequest(); AssertRequestFailed(response); Assert.Null(response.Contents); }
public void GetStoreMetadata_DefaultParams_ReturnsStoreMetaData() { var response = DotaApiClient.GetStoreMetadataAsync() .Result; SleepAfterSendingRequest(); AssertRequestWasSuccessful(response); Assert.NotNull(response.Contents); Assert.NotNull(response.Contents.DropDownData); Assert.NotNull(response.Contents.Filters); Assert.NotNull(response.Contents.HomePageData); Assert.NotNull(response.Contents.PlayerClassData); Assert.NotNull(response.Contents.Sorting); Assert.NotNull(response.Contents.Tabs); }
public async Task MethodGotCancelled_RequestFails() { CancellationTokenSource source = new CancellationTokenSource(); // Start task to be cancelled var task = Task.Run(async() => { return(await DotaApiClient.GetStoreMetadataAsync(cToken: source.Token)); }); // Cancel method source.Cancel(); var response = await task; SleepAfterSendingRequest(); AssertRequestWasCancelled(response); Assert.Null(response.Contents); }