コード例 #1
0
        public async Task EffectsRequestTest(KeyPair client, ConnectionState state, Type excpectedException)
        {
            Global.AppState.State = ApplicationState.Ready;

            var account = Global.AccountStorage.GetAccount(client);

            var clientConnection = new AlphaWebSocketConnection(new FakeWebSocket(), "127.0.0.1")
            {
                ClientPubKey    = client,
                ConnectionState = state,
                Account         = account
            };

            var envelope = new EffectsRequest {
                Account = account.Account.Id, AccountWrapper = account
            }.CreateEnvelope();

            envelope.Sign(client);

            await AssertMessageHandling(clientConnection, envelope, excpectedException);
        }
コード例 #2
0
        public async Task EffectsRequestTest(KeyPair client, ConnectionState state, Type excpectedException)
        {
            context.AppState.State = ApplicationState.Ready;

            var account = context.AccountStorage.GetAccount(client);

            var clientConnection = new AlphaWebSocketConnection(context, new FakeWebSocket(), "127.0.0.1")
            {
                ClientPubKey    = client,
                ConnectionState = state,
                Account         = account
            };

            var envelope = new EffectsRequest {
                Account = account.Account.Id, AccountWrapper = account
            }.CreateEnvelope();

            envelope.Sign(client);

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

            await AssertMessageHandling(clientConnection, inMessage, excpectedException);
        }