public async Task TxNotificationTest(KeyPair clientKeyPair, ConnectionState state, Type excpectedException)
        {
            Global.AppState.State = ApplicationState.Ready;

            var clientConnection = new AlphaWebSocketConnection(new FakeWebSocket(), "127.0.0.1")
            {
                ClientPubKey    = clientKeyPair.PublicKey,
                ConnectionState = state
            };

            var envelope = new TxNotification
            {
                TxCursor = Global.TxCursorManager.TxCursor + 1,
                Payments = new List <PaymentBase>()
            }.CreateEnvelope();

            envelope.Sign(clientKeyPair);

            await AssertMessageHandling(clientConnection, envelope, excpectedException);
        }
        public async Task TxNotificationTest(KeyPair clientKeyPair, ConnectionState state, Type excpectedException)
        {
            context.AppState.State = ApplicationState.Ready;

            var clientConnection = new AlphaWebSocketConnection(context, new FakeWebSocket(), "127.0.0.1")
            {
                ClientPubKey    = clientKeyPair.PublicKey,
                ConnectionState = state
            };

            var envelope = new TxNotification
            {
                TxCursor = context.TxCursorManager.TxCursor + 1,
                Payments = new List <PaymentBase>()
            }.CreateEnvelope();

            envelope.Sign(clientKeyPair);
            using var writer = new XdrBufferWriter();
            var inMessage = envelope.ToIncomingMessage(writer);

            await AssertMessageHandling(clientConnection, inMessage, excpectedException);
        }