Skip to content

Commit

Permalink
Remove susbcribe_to_stream test
Browse files Browse the repository at this point in the history
  • Loading branch information
w1am committed Oct 22, 2024
1 parent 5e5fa68 commit 82b1a44
Showing 1 changed file with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,43 +230,4 @@ async Task Subscribe() {
}
}
}

[Fact]
[Trait("Category", "Special cases")]
[Description("This is normal behavior for EventStoreDB")]
public async Task should_throw_exception_when_subscribing_to_deleted_stream_category() {
var category = Guid.NewGuid().ToString("N");
var streamName = category + "-123";

var seedEvents = Fixture.CreateTestEvents(type: $"{category}-{Fixture.GetStreamName()}").ToArray();
await Fixture.Streams.AppendToStreamAsync(streamName, StreamState.NoStream, seedEvents);
await Fixture.Streams.DeleteAsync(streamName, StreamState.StreamExists);

await using var subscription = Fixture.Streams.SubscribeToStream("$ce-" + category, FromStream.Start, resolveLinkTos: true);

var ex = await Assert.ThrowsAsync<NullReferenceException>(
async () => {
await using var enumerator = subscription.Messages.GetAsyncEnumerator();

Assert.True(await enumerator.MoveNextAsync());

Assert.IsType<StreamMessage.SubscriptionConfirmation>(enumerator.Current);

await Subscribe().WithTimeout();

return;

async Task Subscribe() {
while (await enumerator.MoveNextAsync()) {
if (enumerator.Current is not StreamMessage.Event(var resolvedEvent))
continue;

_ = resolvedEvent.Event.Data;
}
}
}
).WithTimeout();

ex.ShouldNotBeNull();
}
}

0 comments on commit 82b1a44

Please sign in to comment.