File tree Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -311,26 +311,18 @@ public void ExecutePassesThroughParameter()
311311 }
312312
313313 [ Fact ]
314- public void ExecuteExecutesOnTheSpecifiedScheduler ( )
314+ public void ExecuteResultIsDeliveredOnSpecifiedScheduler ( )
315315 {
316316 ( new TestScheduler ( ) ) . With ( sched => {
317- var execute = Observables . Unit . Delay ( TimeSpan . FromSeconds ( 1 ) , sched ) ;
317+ var execute = Observables . Unit ;
318318 var fixture = ReactiveCommand . CreateFromObservable ( ( ) => execute , outputScheduler : sched ) ;
319- var isExecuting = fixture
320- . IsExecuting
321- . CreateCollection ( ) ;
319+ var executed = false ;
322320
323- fixture . Execute ( ) . Subscribe ( ) ;
324- sched . AdvanceByMs ( 999 ) ;
321+ fixture . Execute ( ) . Subscribe ( _ => executed = true ) ;
325322
326- Assert . Equal ( 2 , isExecuting . Count ) ;
327- Assert . False ( isExecuting [ 0 ] ) ;
328- Assert . True ( isExecuting [ 1 ] ) ;
329-
330- sched . AdvanceByMs ( 2 ) ;
331-
332- Assert . Equal ( 3 , isExecuting . Count ) ;
333- Assert . False ( isExecuting [ 2 ] ) ;
323+ Assert . False ( executed ) ;
324+ sched . AdvanceByMs ( 1 ) ;
325+ Assert . True ( executed ) ;
334326 } ) ;
335327 }
336328
Original file line number Diff line number Diff line change @@ -842,7 +842,8 @@ public override IDisposable Subscribe(IObserver<TResult> observer)
842842 return Observable . Throw < TResult > ( ex ) ;
843843 } )
844844 . PublishLast ( )
845- . RefCount ( ) ;
845+ . RefCount ( )
846+ . ObserveOn ( this . outputScheduler ) ;
846847 } catch ( Exception ex ) {
847848 this . exceptions . OnNext ( ex ) ;
848849 return Observable . Throw < TResult > ( ex ) ;
You can’t perform that action at this time.
0 commit comments