コード例 #1
0
        public void GetAsLinkLocal_MacAddressUnExpectedLenth(Int32 length)
        {
            Random random = new Random();

            Byte[] input = random.NextBytes(length);

            Assert.ThrowsAny <ArgumentOutOfRangeException>(() => IPv6Address.GetAsLinkLocal(input));
        }
コード例 #2
0
        public void GetAsLinkLocal(String macAddressInput, String expectedLinkLocalAddress)
        {
            Byte[] input = ByteHelper.GetBytesFromHexString(macAddressInput.Replace(":", String.Empty));

            var actual   = IPv6Address.GetAsLinkLocal(input);
            var expected = IPv6Address.FromString(expectedLinkLocalAddress);

            Assert.Equal(expected, actual);
        }
コード例 #3
0
 public void GetAsLinkLocal_EmptyMacAddress()
 {
     Assert.ThrowsAny <ArgumentNullException>(() => IPv6Address.GetAsLinkLocal(null));
 }