File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public async Task RpcServerValidateStateChange()
4141 Assert . NotNull ( _management ) ;
4242 List < ( State , State ) > states = [ ] ;
4343 await _management . Queue ( _queueName ) . Exclusive ( true ) . AutoDelete ( true ) . DeclareAsync ( ) ;
44- TaskCompletionSource tsc = new ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
44+ TaskCompletionSource < int > tsc = new ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
4545 IRpcServer rpcServer = await _connection . RpcServerBuilder ( ) . Handler ( ( context , request ) =>
4646 {
4747 var m = context . Message ( request . Body ( ) ) ;
@@ -52,12 +52,13 @@ public async Task RpcServerValidateStateChange()
5252 states . Add ( ( fromState , toState ) ) ;
5353 if ( states . Count == 2 )
5454 {
55- tsc . SetResult ( ) ;
55+ tsc . SetResult ( states . Count ) ;
5656 }
5757 } ;
5858 Assert . NotNull ( rpcServer ) ;
5959 await rpcServer . CloseAsync ( ) ;
60- await tsc . Task . WaitAsync ( TimeSpan . FromSeconds ( 5 ) ) ;
60+ int count = await tsc . Task . WaitAsync ( TimeSpan . FromSeconds ( 5 ) ) ;
61+ Assert . Equal ( 2 , count ) ;
6162 Assert . Equal ( State . Open , states [ 0 ] . Item1 ) ;
6263 Assert . Equal ( State . Closing , states [ 0 ] . Item2 ) ;
6364 Assert . Equal ( State . Closing , states [ 1 ] . Item1 ) ;
You can’t perform that action at this time.
0 commit comments