Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
add IPv6 address to test
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Aug 1, 2022
1 parent 74f00cd commit 6473472
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions DragonFruit.Six.Api.Tests/Utils/ServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ public async Task TestGeolocation()
// as we don't know who's running this, there's no real way to validate correctness of this part
await Client.GeolocateAsync().ConfigureAwait(false);

var addressInfo = await Client.GeolocateAsync("8.8.8.8", "172.217.16.238", "194.39.167.145").ConfigureAwait(false);
var addressInfo = await Client.GeolocateAsync("8.8.8.8", "172.217.16.238", "194.39.167.145", "2620:119:35::35").ConfigureAwait(false);
var addressDirectory = addressInfo.ToDictionary(x => x.IP);

// google services
Assert.IsTrue(addressDirectory["8.8.8.8"].ServiceProvider == "Google");
Assert.IsTrue(addressDirectory["172.217.16.238"].ServiceProvider == "Google Servers");
Assert.AreEqual("Google", addressDirectory["8.8.8.8"].ServiceProvider);
Assert.AreEqual("Google Servers", addressDirectory["172.217.16.238"].ServiceProvider);

// IPv6 DNS server
Assert.AreEqual("Cisco OpenDNS, LLC", addressDirectory["2620:119:35::35"].ServiceProvider);

// random ip address from UK
Assert.IsTrue(addressDirectory["194.39.167.145"].CountryName == "United Kingdom");
Assert.AreEqual("United Kingdom", addressDirectory["194.39.167.145"].CountryName);
}

[Test]
Expand Down

0 comments on commit 6473472

Please sign in to comment.