From 9ef1fc34ac6fdb220f65eb3f4ee4070c46276e74 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 20 Nov 2025 17:31:13 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8F=90=E9=AB=98=E4=BB=A3=E7=A0=81=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- binding/csharp/IP2Region.Net.Test/UtilTest.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/binding/csharp/IP2Region.Net.Test/UtilTest.cs b/binding/csharp/IP2Region.Net.Test/UtilTest.cs index aad3a28..8d6eb3d 100644 --- a/binding/csharp/IP2Region.Net.Test/UtilTest.cs +++ b/binding/csharp/IP2Region.Net.Test/UtilTest.cs @@ -4,11 +4,17 @@ namespace IP2Region.Net.Test; public class UtilTest { - [Theory] - [InlineData("114.114.114.114")] - public void TestIpAddressToUInt32(string value) + [Fact] + public void IpAddressToUInt32_Ok() { - var uintIp = XDB.Util.IpAddressToUInt32(value); - Console.WriteLine(uintIp); + var uintIp = XDB.Util.IpAddressToUInt32("114.114.114.114"); + Assert.Equal((uint)1920103026, uintIp); + } + + [Fact] + public void GetMidIp_Ok() + { + var uintIp = XDB.Util.GetMidIp(1, 10); + Assert.Equal((uint)5, uintIp); } } \ No newline at end of file