//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldHaveUsernameAndUserAgent() internal virtual void ShouldHaveUsernameAndUserAgent() { BoltChannel boltChannel = new BoltChannel("bolt-1", "my-bolt", _channel); assertNull(boltChannel.Username()); boltChannel.UpdateUser("hello", "my-bolt-driver/1.2.3"); assertEquals("hello", boltChannel.Username()); assertEquals("my-bolt-driver/1.2.3", boltChannel.UserAgent()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test @SuppressWarnings("deprecation") void shouldExposeClientConnectionInfo() internal virtual void ShouldExposeClientConnectionInfo() { EmbeddedChannel channel = new EmbeddedChannel(); BoltChannel boltChannel = new BoltChannel("bolt-42", "my-bolt", channel); ClientConnectionInfo info1 = boltChannel.Info(); assertEquals("bolt-42", info1.ConnectionId()); assertEquals("bolt", info1.Protocol()); assertEquals(SocketAddress.format(channel.remoteAddress()), info1.ClientAddress()); boltChannel.UpdateUser("Tom", "my-driver"); ClientConnectionInfo info2 = boltChannel.Info(); assertEquals("bolt-42", info2.ConnectionId()); assertEquals("bolt", info2.Protocol()); assertEquals(SocketAddress.format(channel.remoteAddress()), info2.ClientAddress()); assertThat(info2.AsConnectionDetails(), containsString("Tom")); assertThat(info2.AsConnectionDetails(), containsString("my-driver")); }