public SendMessageTests() { var registry = new MessageProcessorRegistry(); registry.Register(typeof(TestMessageProcessor)); registry.Register(typeof(TestMessageOneWayProcessor)); listener = new MessageListener(registry); client = new MessageClient(registry); }
public async Task ClientDisconnectWaitsForMessages() { var registry = new MessageProcessorRegistry(); registry.Register(typeof(DelayedTestProcessor)); using (var listener = new MessageListener(registry)) using (var client = new MessageClient(registry)) { listener.Listen(IPAddress.Loopback, Port); await client.ConnectAsync(Host, Port, CancellationToken.None); DelayedTestProcessor.Complete = false; var message = new DelayedTestRequest(); var _ = client.Send(message).GetResponseAsync <DelayedTestResponse>(); client.Disconnect(); //await task; Assert.That(DelayedTestProcessor.Complete, Is.True); listener.Stop(); } }
public MessageOneWayTests() { registry = new MessageProcessorRegistry(); registry.Register(typeof(TestMessageProcessor)); }