//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldLogContentOfTheMessageOnIOError() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldLogContentOfTheMessageOnIOError() { BoltConnection connection = mock(typeof(BoltConnection)); BoltResponseMessageWriter responseMessageHandler = mock(typeof(BoltResponseMessageWriter)); BoltRequestMessageReader requestMessageReader = new BoltRequestMessageReaderV1(connection, responseMessageHandler, NullLogService.Instance); LogService logService = mock(typeof(LogService)); Log log = mock(typeof(Log)); when(logService.GetInternalLog(typeof(MessageDecoder))).thenReturn(log); _channel = new EmbeddedChannel(new MessageDecoder(PackerUnderTest.newUnpacker, requestMessageReader, logService)); sbyte invalidMessageSignature = sbyte.MaxValue; sbyte[] messageBytes = PackMessageWithSignature(invalidMessageSignature); try { _channel.writeInbound(Unpooled.wrappedBuffer(messageBytes)); fail("Exception expected"); } catch (Exception) { } AssertMessageHexDumpLogged(log, messageBytes); }
private MessageDecoder NewDecoder(BoltConnection connection) { BoltRequestMessageReader reader = new BoltRequestMessageReaderV1(connection, mock(typeof(BoltResponseMessageWriter)), NullLogService.Instance); return(new MessageDecoder(PackerUnderTest.newUnpacker, reader, NullLogService.Instance)); }