public Task SubscribeOneConsumer_Complete_StreamIsCompleted() { return(TryTest(async() => { // arrange var eventDescription = new EventDescription( Guid.NewGuid().ToString()); // act IEventStream consumer = await _registry .SubscribeAsync(eventDescription); await consumer.CompleteAsync(); // assert Assert.True(consumer.IsCompleted); })); }
public Task SubscribeOneConsumer_Complete_StreamIsCompleted() { return(TestHelper.TryTest(async() => { // arrange var cts = new CancellationTokenSource(30000); var eventDescription = new EventDescription( Guid.NewGuid().ToString()); // act IEventStream consumer = await _registry.SubscribeAsync(eventDescription); IAsyncEnumerator <IEventMessage> enumerator = consumer.GetAsyncEnumerator(cts.Token); await consumer.CompleteAsync(); // assert Assert.False(await enumerator.MoveNextAsync()); })); }