Skip to content

Commit fab1288

Browse files
eabaAaronontheweb
andauthored
[74-74] InputStreamSourceSpec (#6622)
Co-authored-by: Aaron Stannard <[email protected]>
1 parent 3a75d0c commit fab1288

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/core/Akka.Streams.Tests/IO/InputStreamSourceSpec.cs

+9-8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Collections.Generic;
1010
using System.IO;
1111
using System.Linq;
12+
using System.Threading.Tasks;
1213
using Akka.IO;
1314
using Akka.Streams.Dsl;
1415
using Akka.Streams.TestKit;
@@ -174,23 +175,22 @@ public void InputStreamSource_must_not_signal_when_no_demand()
174175
}
175176

176177
[Fact]
177-
public void InputStreamSource_must_read_bytes_from_InputStream()
178+
public async Task InputStreamSource_must_read_bytes_from_InputStream()
178179
{
179-
this.AssertAllStagesStopped(() =>
180-
{
181-
var f = StreamConverters.FromInputStream(() => new ListInputStream(new[] {"a", "b", "c"}))
182-
.RunWith(Sink.First<ByteString>(), _materializer);
180+
await this.AssertAllStagesStoppedAsync(() => {
181+
var f = StreamConverters.FromInputStream(() => new ListInputStream(new[] { "a", "b", "c" }))
182+
.RunWith(Sink.First<ByteString>(), _materializer);
183183

184184
f.Wait(TimeSpan.FromSeconds(3)).Should().BeTrue();
185185
f.Result.Should().BeEquivalentTo(ByteString.FromString("abc"));
186+
return Task.CompletedTask;
186187
}, _materializer);
187188
}
188189

189190
[Fact]
190-
public void InputStreamSource_must_emit_as_soon_as_read()
191+
public async Task InputStreamSource_must_emit_as_soon_as_read()
191192
{
192-
this.AssertAllStagesStopped(() =>
193-
{
193+
await this.AssertAllStagesStoppedAsync(() => {
194194
var latch = new TestLatch(1);
195195
var probe = StreamConverters.FromInputStream(() => new EmittedInputStream(latch), chunkSize: 1)
196196
.RunWith(this.SinkProbe<ByteString>(), _materializer);
@@ -199,6 +199,7 @@ public void InputStreamSource_must_emit_as_soon_as_read()
199199
probe.ExpectNext(ByteString.FromString("M"));
200200
latch.CountDown();
201201
probe.ExpectComplete();
202+
return Task.CompletedTask;
202203
}, _materializer);
203204
}
204205
}

0 commit comments

Comments
 (0)