diff --git a/src/core/Akka.Streams.Tests/Dsl/FlowDetacherSpec.cs b/src/core/Akka.Streams.Tests/Dsl/FlowDetacherSpec.cs index cc2e3f74a2b..3f32284fcf8 100644 --- a/src/core/Akka.Streams.Tests/Dsl/FlowDetacherSpec.cs +++ b/src/core/Akka.Streams.Tests/Dsl/FlowDetacherSpec.cs @@ -7,6 +7,7 @@ using System; using System.Linq; +using System.Threading.Tasks; using Akka.Streams.Dsl; using Akka.Streams.TestKit; using Akka.TestKit; @@ -26,22 +27,21 @@ public FlowDetacherSpec(ITestOutputHelper helper) : base(helper) } [Fact] - public void A_Detacher_must_pass_through_all_elements() + public async Task A_Detacher_must_pass_through_all_elements() { - this.AssertAllStagesStopped(() => - { - Source.From(Enumerable.Range(1, 100)) - .Detach() - .RunWith(Sink.Seq(), Materializer) - .Result.Should().BeEquivalentTo(Enumerable.Range(1, 100)); + await this.AssertAllStagesStoppedAsync(() => { + Source.From(Enumerable.Range(1, 100)) + .Detach() + .RunWith(Sink.Seq(), Materializer) + .Result.Should().BeEquivalentTo(Enumerable.Range(1, 100)); + return Task.CompletedTask; }, Materializer); } [Fact] - public void A_Detacher_must_pass_through_failure() + public async Task A_Detacher_must_pass_through_failure() { - this.AssertAllStagesStopped(() => - { + await this.AssertAllStagesStoppedAsync(() => { var ex = new TestException("buh"); var result = Source.From(Enumerable.Range(1, 100)).Select(x => { @@ -51,17 +51,17 @@ public void A_Detacher_must_pass_through_failure() }).Detach().RunWith(Sink.Seq(), Materializer); result.Invoking(r => r.Wait(TimeSpan.FromSeconds(2))).Should().Throw().And.Should().Be(ex); + return Task.CompletedTask; }, Materializer); } [Fact] - public void A_Detacher_must_emit_the_last_element_when_completed_Without_demand() + public async Task A_Detacher_must_emit_the_last_element_when_completed_Without_demand() { - this.AssertAllStagesStopped(() => - { + await this.AssertAllStagesStoppedAsync(async() => { var probe = Source.Single(42).Detach().RunWith(this.SinkProbe(), Materializer).EnsureSubscription(); - probe.ExpectNoMsg(TimeSpan.FromMilliseconds(500)); - probe.RequestNext(42); + await probe.ExpectNoMsgAsync(TimeSpan.FromMilliseconds(500)); + await probe.RequestNextAsync(42); }, Materializer); } }