public async Task QuantaBatchTest(KeyPair alphaKeyPair, ConnectionState state, Type excpectedException) { context.AppState.State = ApplicationState.Ready; var clientConnection = new AuditorWebSocketConnection(context, new FakeAuditorConnectionInfo(new FakeWebSocket())) { ConnectionState = state }; var orderEnvelope = new QuantaBatch { Quanta = new List <MessageEnvelope>() }.CreateEnvelope(); orderEnvelope.Sign(alphaKeyPair); using var writer = new XdrBufferWriter(); var inMessage = orderEnvelope.ToIncomingMessage(writer); await AssertMessageHandling(clientConnection, inMessage, excpectedException); }