private HttpClient CreateTestClientWithBatchConsumer <T>(MqQueue queue, ITestOutputHelper output, ushort size = 2) where T : class, IMqBatchConsumerLogic <TestMqMsg> { return(CreateTestClient(new MqBatchConsumer <TestMqMsg, T>(queue.Name, size) { BatchTimeout = TimeSpan.FromSeconds(2) }, output)); }
private async Task PublishMessages(MqQueue queue, params string[] msgs) { foreach (var msg in msgs) { queue.Publish(new TestMqMsg { Content = msg }); } await Task.Delay(500); }
public void ShouldFailIfQueueNotExists() { //Arrange var queueName = Guid.NewGuid().ToString("N"); var connProvider = new DefaultMqConnectionProvider(TestMqTools.Load()); var chProvider = new DefaultMqChannelProvider(connProvider); var queue = new MqQueue(queueName, chProvider); //Act var exists = queue.IsExists(); //Assert Assert.False(exists); }
private HttpClient CreateTestClientWithSingleConsumer <T>(MqQueue queue, ITestOutputHelper output) where T : class, IMqConsumerLogic <TestMqMsg> { return(CreateTestClient(new MqConsumer <TestMqMsg, T>(queue.Name), output)); }