From 6473472754a060c028540d24351acba10941897e Mon Sep 17 00:00:00 2001 From: Albie Date: Mon, 1 Aug 2022 12:41:37 +0100 Subject: [PATCH] add IPv6 address to test --- DragonFruit.Six.Api.Tests/Utils/ServiceTests.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/DragonFruit.Six.Api.Tests/Utils/ServiceTests.cs b/DragonFruit.Six.Api.Tests/Utils/ServiceTests.cs index 7b4e27ed..94efb8f0 100644 --- a/DragonFruit.Six.Api.Tests/Utils/ServiceTests.cs +++ b/DragonFruit.Six.Api.Tests/Utils/ServiceTests.cs @@ -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]