protected override async Task WhenAsync() { SystemUnderTest.AddQueue(typeof(Message).FullName, _queue); SystemUnderTest.AddMessageHandler(_queue.QueueName, _futureHandler1); SystemUnderTest.AddMessageHandler(_queue.QueueName, _futureHandler2); var cts = new CancellationTokenSource(TimeoutPeriod); await SystemUnderTest.StartAsync(cts.Token); }
protected override async Task WhenAsync() { SystemUnderTest.AddQueue(_region, typeof(Message).FullName, _queue); SystemUnderTest.AddMessageHandler(_queue.QueueName, _futureHandler1); SystemUnderTest.AddMessageHandler(_queue.QueueName, _futureHandler2); var cts = new CancellationTokenSource(); cts.CancelAfter(TimeoutPeriod); await Assert.ThrowsAnyAsync <OperationCanceledException>(() => SystemUnderTest.StartAsync(cts.Token)); }
protected override async Task WhenAsync() { SystemUnderTest.AddMessageHandler(_queue1.QueueName, () => new InspectableHandler <OrderAccepted>()); SystemUnderTest.AddMessageHandler(_queue1.QueueName, () => new InspectableHandler <OrderRejected>()); SystemUnderTest.AddMessageHandler(_queue1.QueueName, () => new InspectableHandler <SimpleMessage>()); SystemUnderTest.AddQueue("region1", "groupA", _queue1); SystemUnderTest.AddQueue("region1", "groupB", _queue2); _cts = new CancellationTokenSource(); _cts.CancelAfter(TimeoutPeriod); await SystemUnderTest.StartAsync(_cts.Token); }
protected override async Task WhenAsync() { SystemUnderTest.AddMessageMiddleware <OrderAccepted>(_queue1.QueueName, new InspectableMiddleware <OrderAccepted>()); SystemUnderTest.AddMessageMiddleware <OrderRejected>(_queue1.QueueName, new InspectableMiddleware <OrderRejected>()); SystemUnderTest.AddMessageMiddleware <SimpleMessage>(_queue1.QueueName, new InspectableMiddleware <SimpleMessage>()); SystemUnderTest.AddQueue("groupA", _queue1); SystemUnderTest.AddQueue("groupB", _queue2); _cts = new CancellationTokenSource(); _cts.CancelAfter(TimeSpan.FromSeconds(5)); await SystemUnderTest.StartAsync(_cts.Token); }
protected override Task WhenAsync() { SystemUnderTest.AddQueue(" ", " ", null); return(Task.CompletedTask); }