Exemplo n.º 1
0
        public void TcpClientAdapterHelperGetMatchingHostReturnsSingleAddressIfFamilyIsUnspecified()
        {
            var address         = IPAddress.Parse("1.1.1.1");
            var matchingAddress = TcpClientAdapterHelper.GetMatchingHost(new[] { address }, AddressFamily.Unspecified);

            Assert.AreEqual(address, matchingAddress);
        }
Exemplo n.º 2
0
        public void TcpClientAdapterHelperGetMatchingHostReturnNoAddressIfFamilyDoesNotMatch()
        {
            var address         = IPAddress.Parse("127.0.0.1");
            var matchingAddress = TcpClientAdapterHelper.GetMatchingHost(new[] { address }, AddressFamily.InterNetworkV6);

            Assert.IsNull(matchingAddress);
        }
Exemplo n.º 3
0
        public void TcpClientAdapterHelperGetMatchingHostReturnNoAddressIfFamilyIsUnspecifiedAndThereIsNoSingleMatch()
        {
            var address         = IPAddress.Parse("1.1.1.1");
            var address2        = IPAddress.Parse("2.2.2.2");
            var matchingAddress = TcpClientAdapterHelper.GetMatchingHost(new[] { address, address2 }, AddressFamily.Unspecified);

            Assert.IsNull(matchingAddress);
        }