public void request_disconnect_if_null_received()
        {
            var readLineAsyncSource = new ReadLineAsyncAlwaysNull();
            var rawLineDecoder = new RawLineDecoder(readLineAsyncSource);

            var disconnectRequested = false;
            rawLineDecoder.RequestDisconnection += (s, e) => { disconnectRequested = true; rawLineDecoder.Cancel(); };
            var processLineCommand = false;
            rawLineDecoder.ProcessLineCommand += (s, l) => processLineCommand = true;

            rawLineDecoder.ProcessCommandsAsync().Wait(100);
            rawLineDecoder.Cancel();

            Assert.True(disconnectRequested);
            Assert.False(processLineCommand);
        }
        public void request_disconnect_if_null_received()
        {
            var readLineAsyncSource = new ReadLineAsyncAlwaysNull();
            var rawLineDecoder      = new RawLineDecoder(readLineAsyncSource);

            var disconnectRequested = false;

            rawLineDecoder.RequestDisconnection += (s, e) => { disconnectRequested = true; rawLineDecoder.Cancel(); };
            var processLineCommand = false;

            rawLineDecoder.ProcessLineCommand += (s, l) => processLineCommand = true;

            rawLineDecoder.ProcessCommandsAsync().Wait(100);
            rawLineDecoder.Cancel();

            Assert.True(disconnectRequested);
            Assert.False(processLineCommand);
        }