Skip to content

Commit

Permalink
[65-74] SubscriberSinkSpec (#6613)
Browse files Browse the repository at this point in the history
* [65-74] `SubscriberSinkSpec`

* Changes to `async/await`
  • Loading branch information
eaba authored Mar 30, 2023
1 parent 725f44b commit 2e1a137
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/core/Akka.Streams.Tests/Dsl/SubscriberSinkSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//-----------------------------------------------------------------------

using System.Linq;
using System.Threading.Tasks;
using Akka.Streams.Dsl;
using Akka.Streams.TestKit;
using Akka.TestKit;
Expand All @@ -25,19 +26,18 @@ public SubscriberSinkSpec(ITestOutputHelper helper = null) : base(helper)
}

[Fact]
public void A_Flow_with_SubscriberSink_must_publish_elements_to_the_subscriber()
public async Task A_Flow_with_SubscriberSink_must_publish_elements_to_the_subscriber()
{
this.AssertAllStagesStopped(() =>
{
await this.AssertAllStagesStoppedAsync(async() => {
var c = this.CreateManualSubscriberProbe<int>();
Source.From(Enumerable.Range(1, 3)).To(Sink.FromSubscriber(c)).Run(Materializer);

var s = c.ExpectSubscription();
var s = await c.ExpectSubscriptionAsync();
s.Request(3);
c.ExpectNext(1);
c.ExpectNext(2);
c.ExpectNext(3);
c.ExpectComplete();
await c.ExpectNextAsync(1);
await c.ExpectNextAsync(2);
await c.ExpectNextAsync(3);
await c.ExpectCompleteAsync();
}, Materializer);
}
}
Expand Down

0 comments on commit 2e1a137

Please sign in to comment.