public async Task ServiceTransportStartTest()
        {
            var            cm = new RequestMessage(OperationCode.ConnectionRequest);
            ServiceMessage rm = null;
            var            aConnectionClosed = false;

            // Called by ReceiveLoop, handle exceptions
            // Aka don't assert in these
            void ProcessCallbackMessage(CallbackMessage message, bool moreComing)
            {
            }

            void ServiceTransportConnectionClosed(ConnectionClosedReason reason)
            {
                aConnectionClosed = true;
            }

            // Called by ReceiveLoop, handle exceptions
            // Aka don't assert in these
            async void ProcessRequestMessage(RequestMessage message)
            {
                rm = message;
                await _provider.Connector.SendToRemote(ServiceError.NoError);
            }

            void ServiceTransportConnectorClosed(ConnectionClosedReason reason)
            {
                aConnectionClosed = true;
            }

            _provider.Connector.Start(ProcessRequestMessage, ServiceTransportConnectorClosed);
            await _transport.StartAsync(cm, ProcessCallbackMessage, ServiceTransportConnectionClosed);

            if (aConnectionClosed)
            {
                throw new Exception("A connection was closed unexpectedly");
            }

            cm.Should().BeEquivalentTo(rm);
        }
        public void Execute(Action <TestServiceTransportProvider, IServiceTransport> action, Action assertAction, bool throwIfConnectionClosed = false)
        {
            var cm = new RequestMessage(OperationCode.ConnectionRequest);

            _provider.Connector.Start(ProcessRequestMessage, ServiceTransportConnectorClosed);
            Func <Task> func = async() => await _transport.StartAsync(cm, ProcessCallbackMessage, ServiceTransportConnectionClosed);

            action?.Invoke(_provider, _transport);

            if (throwIfConnectionClosed)
            {
                ThrowIfConnectionClosed();
            }

            assertAction();

            //cm.Should().BeEquivalentTo(rm);
        }