public void ObfuscatePrivateIP() { Assert.Equal(3316510732u, NetHelpers.GetMsgIPAddress(IPAddress.Loopback).ObfuscatePrivateIP().v4); Assert.Equal(new byte[] { 0x0D, 0xF0, 0xAD, 0xBA, 0x0D, 0xF0, 0xAD, 0xBA, 0x0D, 0xF0, 0xAD, 0xBA, 0x0D, 0xF0, 0xAD, 1 ^ 0xBA }, NetHelpers.GetMsgIPAddress(IPAddress.IPv6Loopback).ObfuscatePrivateIP().v6); }
public void GetMsgIPAddress() { Assert.Equal(2130706433u, NetHelpers.GetMsgIPAddress(IPAddress.Loopback).v4); Assert.Equal(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }, NetHelpers.GetMsgIPAddress(IPAddress.IPv6Loopback).v6); }
public void GetIPAddressFromMsg() { Assert.Equal(IPAddress.Loopback, NetHelpers.GetMsgIPAddress(IPAddress.Loopback).GetIPAddress()); Assert.Equal(IPAddress.IPv6Loopback, NetHelpers.GetMsgIPAddress(IPAddress.IPv6Loopback).GetIPAddress()); }