mirror of
https://github.com/lionsoul2014/ip2region.git
synced 2025-12-08 19:25:22 +00:00
20 lines
388 B
C#
20 lines
388 B
C#
using Xunit;
|
|
|
|
namespace IP2Region.Net.Test;
|
|
|
|
public class UtilTest
|
|
{
|
|
[Fact]
|
|
public void IpAddressToUInt32_Ok()
|
|
{
|
|
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);
|
|
}
|
|
} |