|
7 | 7 |
|
8 | 8 | using System;
|
9 | 9 | using System.Collections.Generic;
|
| 10 | +using System.Threading.Tasks; |
10 | 11 | using Akka.Streams.Dsl;
|
11 | 12 | using Akka.TestKit;
|
12 | 13 | using FluentAssertions;
|
@@ -62,74 +63,74 @@ protected IPublisher<T> SoonToCompletePublisher<T>()
|
62 | 63 | }
|
63 | 64 |
|
64 | 65 | [Fact]
|
65 |
| - public void Should_work_with_two_immediately_completed_publishers() |
| 66 | + public async Task Should_work_with_two_immediately_completed_publishers() |
66 | 67 | {
|
67 |
| - this.AssertAllStagesStopped(() => |
| 68 | + await this.AssertAllStagesStoppedAsync(async () => |
68 | 69 | {
|
69 | 70 | var subscriber = Setup(CompletedPublisher<int>(), CompletedPublisher<int>());
|
70 |
| - subscriber.ExpectSubscriptionAndComplete(); |
| 71 | + await subscriber.ExpectSubscriptionAndCompleteAsync().Task; |
71 | 72 | }, Materializer);
|
72 | 73 | }
|
73 | 74 |
|
74 | 75 | [Fact]
|
75 |
| - public void Should_work_with_two_delayed_completed_publishers() |
| 76 | + public async Task Should_work_with_two_delayed_completed_publishers() |
76 | 77 | {
|
77 |
| - this.AssertAllStagesStopped(() => |
| 78 | + await this.AssertAllStagesStoppedAsync(async () => |
78 | 79 | {
|
79 | 80 | var subscriber = Setup(SoonToCompletePublisher<int>(), SoonToCompletePublisher<int>());
|
80 |
| - subscriber.ExpectSubscriptionAndComplete(); |
| 81 | + await subscriber.ExpectSubscriptionAndCompleteAsync().Task; |
81 | 82 | }, Materializer);
|
82 | 83 | }
|
83 | 84 |
|
84 | 85 | [Fact]
|
85 |
| - public void Should_work_with_one_immediately_completed_and_one_delayed_completed_publisher() |
| 86 | + public async Task Should_work_with_one_immediately_completed_and_one_delayed_completed_publisher() |
86 | 87 | {
|
87 |
| - this.AssertAllStagesStopped(() => |
| 88 | + await this.AssertAllStagesStoppedAsync(async () => |
88 | 89 | {
|
89 | 90 | var subscriber = Setup(CompletedPublisher<int>(), SoonToCompletePublisher<int>());
|
90 |
| - subscriber.ExpectSubscriptionAndComplete(); |
| 91 | + await subscriber.ExpectSubscriptionAndCompleteAsync().Task; |
91 | 92 | }, Materializer);
|
92 | 93 | }
|
93 | 94 |
|
94 | 95 | [Fact]
|
95 |
| - public void Should_work_with_two_immediately_failed_publishers() |
| 96 | + public async Task Should_work_with_two_immediately_failed_publishers() |
96 | 97 | {
|
97 |
| - this.AssertAllStagesStopped(() => |
| 98 | + await this.AssertAllStagesStoppedAsync(async () => |
98 | 99 | {
|
99 | 100 | var subscriber = Setup(FailedPublisher<int>(), FailedPublisher<int>());
|
100 |
| - subscriber.ExpectSubscriptionAndError().Should().Be(TestException()); |
| 101 | + (await subscriber.ExpectSubscriptionAndErrorAsync()).Should().Be(TestException()); |
101 | 102 | }, Materializer);
|
102 | 103 | }
|
103 | 104 |
|
104 | 105 | [Fact]
|
105 |
| - public void Should_work_with_two_delayed_failed_publishers() |
| 106 | + public async Task Should_work_with_two_delayed_failed_publishers() |
106 | 107 | {
|
107 |
| - this.AssertAllStagesStopped(() => |
| 108 | + await this.AssertAllStagesStoppedAsync(async () => |
108 | 109 | {
|
109 | 110 | var subscriber = Setup(SoonToFailPublisher<int>(), SoonToFailPublisher<int>());
|
110 |
| - subscriber.ExpectSubscriptionAndError().Should().Be(TestException()); |
| 111 | + (await subscriber.ExpectSubscriptionAndErrorAsync()).Should().Be(TestException()); |
111 | 112 | }, Materializer);
|
112 | 113 | }
|
113 | 114 |
|
114 | 115 | // Warning: The two test cases below are somewhat implementation specific and might fail if the implementation
|
115 | 116 | // is changed. They are here to be an early warning though.
|
116 | 117 | [Fact]
|
117 |
| - public void Should_work_with_one_immediately_failed_and_one_delayed_failed_publisher_case_1() |
| 118 | + public async Task Should_work_with_one_immediately_failed_and_one_delayed_failed_publisher_case_1() |
118 | 119 | {
|
119 |
| - this.AssertAllStagesStopped(() => |
| 120 | + await this.AssertAllStagesStoppedAsync(async () => |
120 | 121 | {
|
121 | 122 | var subscriber = Setup(SoonToFailPublisher<int>(), FailedPublisher<int>());
|
122 |
| - subscriber.ExpectSubscriptionAndError().Should().Be(TestException()); |
| 123 | + (await subscriber.ExpectSubscriptionAndErrorAsync()).Should().Be(TestException()); |
123 | 124 | }, Materializer);
|
124 | 125 | }
|
125 | 126 |
|
126 | 127 | [Fact]
|
127 |
| - public void Should_work_with_one_immediately_failed_and_one_delayed_failed_publisher_case_2() |
| 128 | + public async Task Should_work_with_one_immediately_failed_and_one_delayed_failed_publisher_case_2() |
128 | 129 | {
|
129 |
| - this.AssertAllStagesStopped(() => |
| 130 | + await this.AssertAllStagesStoppedAsync(async () => |
130 | 131 | {
|
131 | 132 | var subscriber = Setup(FailedPublisher<int>(), SoonToFailPublisher<int>());
|
132 |
| - subscriber.ExpectSubscriptionAndError().Should().Be(TestException()); |
| 133 | + (await subscriber.ExpectSubscriptionAndErrorAsync()).Should().Be(TestException()); |
133 | 134 | }, Materializer);
|
134 | 135 | }
|
135 | 136 | }
|
|
0 commit comments