public async Task RangesTest() => await BaseTests.ApiTestAsync(async (api, cancellationToken) => { var response = await api.GetRangesAsync("comcast.net", cancellationToken); Assert.IsNotNull(response, nameof(response)); Console.WriteLine(response.GetPropertiesText()); });
public async Task HostedDomainsTest() => await BaseTests.ApiTestAsync(async (api, cancellationToken) => { var response = await api.GetDomainsAsync("1.1.1.1", cancellationToken); Assert.IsNotNull(response, nameof(response)); Console.WriteLine(response.GetPropertiesText()); });
public async Task GetPrivacyInformationByIpTest() => await BaseTests.ApiTestAsync(async (api, cancellationToken) => { var response = await api.GetPrivacyInformationByIpAsync("8.8.8.8", cancellationToken); Assert.IsNotNull(response, nameof(response)); Console.WriteLine(response.GetPropertiesText()); });
public async Task BatchTest() => await BaseTests.ApiTestAsync(async (api, cancellationToken) => { var dictionary = await api.BatchAsync(new [] { "8.8.8.8", "8.8.8.8/city", }, cancellationToken); Assert.IsNotNull(dictionary, nameof(dictionary)); foreach (var pair in dictionary) { Console.WriteLine($"{pair.Key}: {pair.Value}"); } });
public async Task GetInformationByIpsTest() => await BaseTests.ApiTestAsync(async (api, cancellationToken) => { var dictionary = await api.GetInformationByIpsAsync(new[] { "8.8.8.8", "8.8.4.4", }, cancellationToken); Assert.IsNotNull(dictionary, nameof(dictionary)); foreach (var pair in dictionary) { Assert.IsNotNull(pair.Value, nameof(pair.Value)); Console.WriteLine($"{pair.Key}:"); foreach (var property in pair.Value.GetType().GetProperties()) { Console.WriteLine($" {property.Name}: {property.GetValue(pair.Value)}"); } Console.WriteLine(); } });