@@ -129,7 +129,7 @@ public void given_external_producer_then_can_notify_event()
129129 public void given_external_producer_then_can_notify_eventAsync()
130130 {
131131 */
132- public async Task given_external_producer_then_can_notify_eventAsync ( )
132+ public void given_external_producer_then_can_notify_eventAsync ( )
133133 {
134134 var producer = new Subject < ConcreteEvent > ( ) ;
135135
@@ -143,81 +143,81 @@ public async Task given_external_producer_then_can_notify_eventAsync()
143143
144144 bus . Observe < ConcreteEvent > ( ) . Subscribe ( e => actual = e ) ;
145145
146- await bus . NotifyAsync ( expected ) ;
146+ bus . Notify ( expected ) ;
147147
148148 Assert . Equal ( expected , actual ) ;
149149 }
150150
151151 [ Fact ]
152- public async Task when_subscribing_subject_then_succeedsAsync ( )
152+ public void when_subscribing_subject_then_succeedsAsync ( )
153153 {
154154 int ? value = default ;
155155 bus . Observe < int > ( ) . Subscribe ( i => value = i ) ;
156156
157- await bus . NotifyAsync ( 42 ) ;
157+ bus . Notify ( 42 ) ;
158158
159159 Assert . Equal ( 42 , value ) ;
160160 }
161161
162162 [ Fact ]
163- public Task when_notifying_null_event_then_throws ( )
164- => Assert . ThrowsAsync < ArgumentNullException > ( async ( ) => await bus . NotifyAsync < object ? > ( null ) ) ;
163+ public void when_notifying_null_event_then_throws ( )
164+ => Assert . Throws < ArgumentNullException > ( ( ) => bus . Notify < object ? > ( null ) ) ;
165165
166166 [ Fact ]
167- public async Task when_notifying_non_public_event_type_then_calls_subscriber ( )
167+ public void when_notifying_non_public_event_type_then_calls_subscriber ( )
168168 {
169169 var called = false ;
170170
171171 bus . Observe < NonPublicEvent > ( ) . Subscribe ( x => called = true ) ;
172172
173- await bus . NotifyAsync ( new NonPublicEvent ( ) ) ;
173+ bus . Notify ( new NonPublicEvent ( ) ) ;
174174
175175 Assert . True ( called ) ;
176176 }
177177
178178 [ Fact ]
179- public async Task when_notifying_nested_non_public_event_type_then_calls_subscriber ( )
179+ public void when_notifying_nested_non_public_event_type_then_calls_subscriber ( )
180180 {
181181 var called = false ;
182182
183183 bus . Observe < NestedEvent > ( ) . Subscribe ( x => called = true ) ;
184184
185- await bus . NotifyAsync ( new NestedEvent ( ) ) ;
185+ bus . Notify ( new NestedEvent ( ) ) ;
186186
187187 Assert . True ( called ) ;
188188 }
189189
190190 [ Fact ]
191- public async Task when_notifying_non_subscribed_event_then_does_not_call_subscriber ( )
191+ public void when_notifying_non_subscribed_event_then_does_not_call_subscriber ( )
192192 {
193193 var called = false ;
194194
195195 using var subs = bus . Observe < ConcreteEvent > ( ) . Subscribe ( c => called = true ) ;
196196
197- await bus . NotifyAsync ( new AnotherEvent ( ) ) ;
197+ bus . Notify ( new AnotherEvent ( ) ) ;
198198
199199 Assert . False ( called ) ;
200200 }
201201
202202 [ Fact ]
203- public async Task when_notifying_subscribed_event_using_base_type_then_calls_derived_subscriber ( )
203+ public void when_notifying_subscribed_event_using_base_type_then_calls_derived_subscriber ( )
204204 {
205205 var called = false ;
206206 using var subscription = bus . Observe < ConcreteEvent > ( ) . Subscribe ( c => called = true ) ;
207207
208208 BaseEvent e = new ConcreteEvent ( ) ;
209- await bus . NotifyAsync ( e ) ;
209+ bus . Notify ( e ) ;
210210
211211 Assert . True ( called ) ;
212212 }
213213
214214 [ Fact ]
215- public async Task when_subscribing_as_event_interface_then_calls_subscriber ( )
215+ public void when_subscribing_as_event_interface_then_calls_subscriber ( )
216216 {
217217 var called = false ;
218218 using var subs = bus . Observe < IBaseEvent > ( ) . Subscribe ( c => called = true ) ;
219219
220- await bus . NotifyAsync ( new ConcreteEvent ( ) ) ;
220+ bus . Notify ( new ConcreteEvent ( ) ) ;
221221
222222 Assert . True ( called ) ;
223223 }
@@ -491,19 +491,15 @@ public void when_executing_nested_public_command_then_invokes_handler()
491491 bus . Execute ( command ) ;
492492
493493 handler . Verify ( x => x . Execute ( command ) ) ;
494-
495- bus . Observe < ConcreteEvent > ( )
496- . Select ( value => Observable . FromAsync ( async ( ) => await OnSolutionOpened ( value ) ) )
497- . Subscribe ( ) ;
498494 }
499495
500- async Task OnSolutionOpened ( ConcreteEvent e )
496+ void OnSolutionOpened ( ConcreteEvent e )
501497 {
502498 // do something, perhaps execute some command?
503499 // bus.Execute(new MyCommand("Hello World"));
504500
505501 // perhaps raise further events?
506- await bus . NotifyAsync ( new ConcreteEvent ( ) ) ;
502+ bus . Notify ( new ConcreteEvent ( ) ) ;
507503 }
508504
509505 [ Fact ]
@@ -543,7 +539,7 @@ public async Task when_executing_non_public_àsynccommand_result_then_invokes_ha
543539 }
544540
545541 [ Fact ]
546- public async Task when_notifying_can_access_event_from_activity_stop ( )
542+ public void when_notifying_can_access_event_from_activity_stop ( )
547543 {
548544 Activity ? activity = default ;
549545 using var listener = new ActivityListener
@@ -559,7 +555,7 @@ public async Task when_notifying_can_access_event_from_activity_stop()
559555
560556 ActivitySource . AddActivityListener ( listener ) ;
561557
562- await bus . NotifyAsync ( new ConcreteEvent ( ) ) ;
558+ bus . Notify ( new ConcreteEvent ( ) ) ;
563559
564560 Assert . NotNull ( activity ) ;
565561 Assert . IsType < ConcreteEvent > ( activity . GetCustomProperty ( "Event" ) ) ;
0 commit comments