@@ -337,7 +337,7 @@ public async Task CanStreamClientMethodFromServer(string protocolName, HttpTrans
337
337
await connection . StartAsync ( ) . OrTimeout ( ) ;
338
338
339
339
var channel = await connection . StreamAsChannelAsync < int > ( "Stream" , 5 ) . OrTimeout ( ) ;
340
- var results = await channel . ReadAllAsync ( ) . OrTimeout ( ) ;
340
+ var results = await channel . ReadAndCollectAllAsync ( ) . OrTimeout ( ) ;
341
341
342
342
Assert . Equal ( new [ ] { 0 , 1 , 2 , 3 , 4 } , results . ToArray ( ) ) ;
343
343
}
@@ -375,7 +375,7 @@ public async Task CanStreamToAndFromClientInSameInvocation(string protocolName,
375
375
Assert . Equal ( "2" , await channel . ReadAsync ( ) . AsTask ( ) . OrTimeout ( ) ) ;
376
376
channelWriter . Writer . Complete ( ) ;
377
377
378
- var results = await channel . ReadAllAsync ( ) . OrTimeout ( ) ;
378
+ var results = await channel . ReadAndCollectAllAsync ( ) . OrTimeout ( ) ;
379
379
Assert . Empty ( results ) ;
380
380
}
381
381
catch ( Exception ex )
@@ -420,7 +420,7 @@ bool ExpectedErrors(WriteContext writeContext)
420
420
421
421
cts . Cancel ( ) ;
422
422
423
- var results = await channel . ReadAllAsync ( suppressExceptions : true ) . OrTimeout ( ) ;
423
+ var results = await channel . ReadAndCollectAllAsync ( suppressExceptions : true ) . OrTimeout ( ) ;
424
424
425
425
Assert . True ( results . Count > 0 && results . Count < 1000 ) ;
426
426
@@ -488,7 +488,7 @@ bool ExpectedErrors(WriteContext writeContext)
488
488
await connection . StartAsync ( ) . OrTimeout ( ) ;
489
489
var channel = await connection . StreamAsChannelAsync < int > ( "StreamException" ) . OrTimeout ( ) ;
490
490
491
- var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAllAsync ( ) . OrTimeout ( ) ) ;
491
+ var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAndCollectAllAsync ( ) . OrTimeout ( ) ) ;
492
492
Assert . Equal ( "An unexpected error occurred invoking 'StreamException' on the server. InvalidOperationException: Error occurred while streaming." , ex . Message ) ;
493
493
}
494
494
catch ( Exception ex )
@@ -654,7 +654,7 @@ bool ExpectedErrors(WriteContext writeContext)
654
654
await connection . StartAsync ( ) . OrTimeout ( ) ;
655
655
656
656
var channel = await connection . StreamAsChannelAsync < int > ( "!@#$%" ) ;
657
- var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAllAsync ( ) . OrTimeout ( ) ) ;
657
+ var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAndCollectAllAsync ( ) . OrTimeout ( ) ) ;
658
658
Assert . Equal ( "Failed to invoke '!@#$%' due to an error on the server. HubException: Method does not exist." , ex . Message ) ;
659
659
}
660
660
catch ( Exception ex )
@@ -688,7 +688,7 @@ bool ExpectedErrors(WriteContext writeContext)
688
688
await connection . StartAsync ( ) . OrTimeout ( ) ;
689
689
690
690
var channel = await connection . StreamAsChannelAsync < int > ( "Stream" , 42 , 42 ) ;
691
- var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAllAsync ( ) . OrTimeout ( ) ) ;
691
+ var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAndCollectAllAsync ( ) . OrTimeout ( ) ) ;
692
692
Assert . Equal ( "Failed to invoke 'Stream' due to an error on the server. InvalidDataException: Invocation provides 2 argument(s) but target expects 1." , ex . Message ) ;
693
693
}
694
694
catch ( Exception ex )
@@ -722,7 +722,7 @@ bool ExpectedErrors(WriteContext writeContext)
722
722
await connection . StartAsync ( ) . OrTimeout ( ) ;
723
723
724
724
var channel = await connection . StreamAsChannelAsync < int > ( "Stream" , "xyz" ) ;
725
- var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAllAsync ( ) . OrTimeout ( ) ) ;
725
+ var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAndCollectAllAsync ( ) . OrTimeout ( ) ) ;
726
726
Assert . Equal ( "Failed to invoke 'Stream' due to an error on the server. InvalidDataException: Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked." , ex . Message ) ;
727
727
}
728
728
catch ( Exception ex )
@@ -755,7 +755,7 @@ bool ExpectedErrors(WriteContext writeContext)
755
755
{
756
756
await connection . StartAsync ( ) . OrTimeout ( ) ;
757
757
var channel = await connection . StreamAsChannelAsync < int > ( "HelloWorld" ) . OrTimeout ( ) ;
758
- var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAllAsync ( ) ) . OrTimeout ( ) ;
758
+ var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAndCollectAllAsync ( ) ) . OrTimeout ( ) ;
759
759
Assert . Equal ( "The client attempted to invoke the non-streaming 'HelloWorld' method with a streaming invocation." , ex . Message ) ;
760
760
}
761
761
catch ( Exception ex )
@@ -821,7 +821,7 @@ bool ExpectedErrors(WriteContext writeContext)
821
821
{
822
822
await connection . StartAsync ( ) . OrTimeout ( ) ;
823
823
var channel = await connection . StreamAsChannelAsync < int > ( "StreamBroken" ) . OrTimeout ( ) ;
824
- var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAllAsync ( ) ) . OrTimeout ( ) ;
824
+ var ex = await Assert . ThrowsAsync < HubException > ( ( ) => channel . ReadAndCollectAllAsync ( ) ) . OrTimeout ( ) ;
825
825
Assert . Equal ( "The value returned by the streaming method 'StreamBroken' is not a ChannelReader<>." , ex . Message ) ;
826
826
}
827
827
catch ( Exception ex )
0 commit comments