Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldFailOnMissingPort()
        internal virtual void ShouldFailOnMissingPort()
        {
            string addressString = "localhost:";

//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            assertThrows(typeof(System.ArgumentException), () => SocketAddressParser.SocketAddress(addressString, SocketAddress::new));
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldFailToCreateSocketWithTrailingNonNumbers()
        internal virtual void ShouldFailToCreateSocketWithTrailingNonNumbers()
        {
            string addressString = "localhost:9999abc";

//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            assertThrows(typeof(System.ArgumentException), () => SocketAddressParser.SocketAddress(addressString, SocketAddress::new));
        }
Пример #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldFailToCreateSocketAddressWithMixedInWhitespace()
        internal virtual void ShouldFailToCreateSocketAddressWithMixedInWhitespace()
        {
            string addressString = "localhost" + Whitespace(1) + ":9999";

//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            assertThrows(typeof(System.ArgumentException), () => SocketAddressParser.SocketAddress(addressString, SocketAddress::new));
        }
Пример #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldSupportDomainNameWithPort()
        internal virtual void ShouldSupportDomainNameWithPort()
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            SocketAddress socketAddress = SocketAddressParser.SocketAddress("my.domain:123", SocketAddress::new);

            assertEquals("my.domain", socketAddress.Hostname);
            assertEquals(123, socketAddress.Port);
            assertEquals("my.domain:123", socketAddress.ToString());
        }
Пример #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldSupportIPv6WildcardWithoutBrackets()
        internal virtual void ShouldSupportIPv6WildcardWithoutBrackets()
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            SocketAddress socketAddress = SocketAddressParser.SocketAddress(":::123", SocketAddress::new);

            assertEquals("::", socketAddress.Hostname);
            assertEquals(123, socketAddress.Port);
            assertEquals("[::]:123", socketAddress.ToString());
            assertTrue(socketAddress.Wildcard);
        }
Пример #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldSupportIPv6WithZoneId()
        internal virtual void ShouldSupportIPv6WithZoneId()
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            SocketAddress socketAddress = SocketAddressParser.SocketAddress("[fe80::b279:2f%en0]:123", SocketAddress::new);

            assertEquals("fe80::b279:2f%en0", socketAddress.Hostname);
            assertEquals(123, socketAddress.Port);
            assertEquals("[fe80::b279:2f%en0]:123", socketAddress.ToString());
            assertFalse(socketAddress.Wildcard);
        }
Пример #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldCreateAdvertisedSocketAddressWithTrailingWhitespace()
        internal virtual void ShouldCreateAdvertisedSocketAddressWithTrailingWhitespace()
        {
            // given
            string addressString = "localhost:9999" + Whitespace(2);

            // when
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            SocketAddress address = SocketAddressParser.SocketAddress(addressString, SocketAddress::new);

            // then
            assertEquals("localhost", address.Hostname);
            assertEquals(9999, address.Port);
        }