@@ -491,13 +491,8 @@ public async Task StreamAsyncTest(string protocolName, HttpTransportType transpo
491
491
[ LogLevel ( LogLevel . Trace ) ]
492
492
public async Task StreamAsyncDoesNotStartIfTokenAlreadyCanceled ( string protocolName , HttpTransportType transportType , string path )
493
493
{
494
- bool ExpectedErrors ( WriteContext writeContext )
495
- {
496
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
497
- writeContext . EventId . Name == "FailedInvokingHubMethod" ;
498
- }
499
494
var protocol = HubProtocols [ protocolName ] ;
500
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
495
+ using ( StartServer < Startup > ( out var server ) )
501
496
{
502
497
var connection = CreateHubConnection ( server . Url , path , transportType , protocol , LoggerFactory ) ;
503
498
try
@@ -901,16 +896,8 @@ await Assert.ThrowsAsync<TaskCanceledException>(async () =>
901
896
[ LogLevel ( LogLevel . Trace ) ]
902
897
public async Task CanCloseStreamMethodEarly ( string protocolName , HttpTransportType transportType , string path )
903
898
{
904
- bool ExpectedErrors ( WriteContext writeContext )
905
- {
906
- // Writing is not allowed after writer was completed.
907
- // Can happen since we are closing the connection while the connection could still be writing the streaming data
908
- return writeContext . LoggerName == typeof ( HubConnectionContext ) . FullName &&
909
- writeContext . EventId . Name == "FailedWritingMessage" ;
910
- }
911
-
912
899
var protocol = HubProtocols [ protocolName ] ;
913
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
900
+ using ( StartServer < Startup > ( out var server ) )
914
901
{
915
902
var connection = CreateHubConnection ( server . Url , path , transportType , protocol , LoggerFactory ) ;
916
903
try
@@ -1013,14 +1000,8 @@ bool ExpectedErrors(WriteContext writeContext)
1013
1000
[ MemberData ( nameof ( HubProtocolsAndTransportsAndHubPaths ) ) ]
1014
1001
public async Task ServerThrowsHubExceptionIfHubMethodCannotBeResolved ( string hubProtocolName , HttpTransportType transportType , string hubPath )
1015
1002
{
1016
- bool ExpectedErrors ( WriteContext writeContext )
1017
- {
1018
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
1019
- writeContext . EventId . Name == "FailedInvokingHubMethod" ;
1020
- }
1021
-
1022
1003
var hubProtocol = HubProtocols [ hubProtocolName ] ;
1023
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1004
+ using ( StartServer < Startup > ( out var server ) )
1024
1005
{
1025
1006
var connection = CreateHubConnection ( server . Url , hubPath , transportType , hubProtocol , LoggerFactory ) ;
1026
1007
try
@@ -1046,14 +1027,8 @@ bool ExpectedErrors(WriteContext writeContext)
1046
1027
[ MemberData ( nameof ( HubProtocolsAndTransportsAndHubPaths ) ) ]
1047
1028
public async Task ServerThrowsHubExceptionIfHubMethodCannotBeResolvedAndArgumentsPassedIn ( string hubProtocolName , HttpTransportType transportType , string hubPath )
1048
1029
{
1049
- bool ExpectedErrors ( WriteContext writeContext )
1050
- {
1051
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
1052
- writeContext . EventId . Name == "FailedInvokingHubMethod" ;
1053
- }
1054
-
1055
1030
var hubProtocol = HubProtocols [ hubProtocolName ] ;
1056
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1031
+ using ( StartServer < Startup > ( out var server ) )
1057
1032
{
1058
1033
var connection = CreateHubConnection ( server . Url , hubPath , transportType , hubProtocol , LoggerFactory ) ;
1059
1034
try
@@ -1079,14 +1054,8 @@ bool ExpectedErrors(WriteContext writeContext)
1079
1054
[ MemberData ( nameof ( HubProtocolsList ) ) ]
1080
1055
public async Task ServerThrowsHubExceptionOnHubMethodArgumentCountMismatch ( string hubProtocolName )
1081
1056
{
1082
- bool ExpectedErrors ( WriteContext writeContext )
1083
- {
1084
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
1085
- writeContext . EventId . Name == "FailedInvokingHubMethod" ;
1086
- }
1087
-
1088
1057
var hubProtocol = HubProtocols [ hubProtocolName ] ;
1089
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1058
+ using ( StartServer < Startup > ( out var server ) )
1090
1059
{
1091
1060
var connection = CreateHubConnection ( server . Url , "/default" , HttpTransportType . LongPolling , hubProtocol , LoggerFactory ) ;
1092
1061
try
@@ -1112,14 +1081,8 @@ bool ExpectedErrors(WriteContext writeContext)
1112
1081
[ MemberData ( nameof ( HubProtocolsAndTransportsAndHubPaths ) ) ]
1113
1082
public async Task ServerThrowsHubExceptionOnHubMethodArgumentTypeMismatch ( string hubProtocolName , HttpTransportType transportType , string hubPath )
1114
1083
{
1115
- bool ExpectedErrors ( WriteContext writeContext )
1116
- {
1117
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
1118
- writeContext . EventId . Name == "FailedInvokingHubMethod" ;
1119
- }
1120
-
1121
1084
var hubProtocol = HubProtocols [ hubProtocolName ] ;
1122
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1085
+ using ( StartServer < Startup > ( out var server ) )
1123
1086
{
1124
1087
var connection = CreateHubConnection ( server . Url , hubPath , transportType , hubProtocol , LoggerFactory ) ;
1125
1088
try
@@ -1145,14 +1108,8 @@ bool ExpectedErrors(WriteContext writeContext)
1145
1108
[ MemberData ( nameof ( HubProtocolsAndTransportsAndHubPaths ) ) ]
1146
1109
public async Task ServerThrowsHubExceptionIfStreamingHubMethodCannotBeResolved ( string hubProtocolName , HttpTransportType transportType , string hubPath )
1147
1110
{
1148
- bool ExpectedErrors ( WriteContext writeContext )
1149
- {
1150
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
1151
- writeContext . EventId . Name == "FailedInvokingHubMethod" ;
1152
- }
1153
-
1154
1111
var hubProtocol = HubProtocols [ hubProtocolName ] ;
1155
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1112
+ using ( StartServer < Startup > ( out var server ) )
1156
1113
{
1157
1114
var connection = CreateHubConnection ( server . Url , hubPath , transportType , hubProtocol , LoggerFactory ) ;
1158
1115
try
@@ -1179,14 +1136,8 @@ bool ExpectedErrors(WriteContext writeContext)
1179
1136
[ MemberData ( nameof ( HubProtocolsAndTransportsAndHubPaths ) ) ]
1180
1137
public async Task ServerThrowsHubExceptionOnStreamingHubMethodArgumentCountMismatch ( string hubProtocolName , HttpTransportType transportType , string hubPath )
1181
1138
{
1182
- bool ExpectedErrors ( WriteContext writeContext )
1183
- {
1184
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
1185
- writeContext . EventId . Name == "FailedInvokingHubMethod" ;
1186
- }
1187
-
1188
1139
var hubProtocol = HubProtocols [ hubProtocolName ] ;
1189
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1140
+ using ( StartServer < Startup > ( out var server ) )
1190
1141
{
1191
1142
var connection = CreateHubConnection ( server . Url , hubPath , transportType , hubProtocol , LoggerFactory ) ;
1192
1143
try
@@ -1213,14 +1164,8 @@ bool ExpectedErrors(WriteContext writeContext)
1213
1164
[ MemberData ( nameof ( HubProtocolsAndTransportsAndHubPaths ) ) ]
1214
1165
public async Task ServerThrowsHubExceptionOnStreamingHubMethodArgumentTypeMismatch ( string hubProtocolName , HttpTransportType transportType , string hubPath )
1215
1166
{
1216
- bool ExpectedErrors ( WriteContext writeContext )
1217
- {
1218
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
1219
- writeContext . EventId . Name == "FailedInvokingHubMethod" ;
1220
- }
1221
-
1222
1167
var hubProtocol = HubProtocols [ hubProtocolName ] ;
1223
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1168
+ using ( StartServer < Startup > ( out var server ) )
1224
1169
{
1225
1170
var connection = CreateHubConnection ( server . Url , hubPath , transportType , hubProtocol , LoggerFactory ) ;
1226
1171
try
@@ -1247,14 +1192,8 @@ bool ExpectedErrors(WriteContext writeContext)
1247
1192
[ MemberData ( nameof ( HubProtocolsAndTransportsAndHubPaths ) ) ]
1248
1193
public async Task ServerThrowsHubExceptionIfNonStreamMethodInvokedWithStreamAsync ( string hubProtocolName , HttpTransportType transportType , string hubPath )
1249
1194
{
1250
- bool ExpectedErrors ( WriteContext writeContext )
1251
- {
1252
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
1253
- writeContext . EventId . Name == "NonStreamingMethodCalledWithStream" ;
1254
- }
1255
-
1256
1195
var hubProtocol = HubProtocols [ hubProtocolName ] ;
1257
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1196
+ using ( StartServer < Startup > ( out var server ) )
1258
1197
{
1259
1198
var connection = CreateHubConnection ( server . Url , hubPath , transportType , hubProtocol , LoggerFactory ) ;
1260
1199
try
@@ -1280,14 +1219,8 @@ bool ExpectedErrors(WriteContext writeContext)
1280
1219
[ MemberData ( nameof ( HubProtocolsAndTransportsAndHubPaths ) ) ]
1281
1220
public async Task ServerThrowsHubExceptionIfStreamMethodInvokedWithInvoke ( string hubProtocolName , HttpTransportType transportType , string hubPath )
1282
1221
{
1283
- bool ExpectedErrors ( WriteContext writeContext )
1284
- {
1285
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
1286
- writeContext . EventId . Name == "StreamingMethodCalledWithInvoke" ;
1287
- }
1288
-
1289
1222
var hubProtocol = HubProtocols [ hubProtocolName ] ;
1290
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1223
+ using ( StartServer < Startup > ( out var server ) )
1291
1224
{
1292
1225
var connection = CreateHubConnection ( server . Url , hubPath , transportType , hubProtocol , LoggerFactory ) ;
1293
1226
try
@@ -1313,14 +1246,8 @@ bool ExpectedErrors(WriteContext writeContext)
1313
1246
[ MemberData ( nameof ( HubProtocolsAndTransportsAndHubPaths ) ) ]
1314
1247
public async Task ServerThrowsHubExceptionIfBuildingAsyncEnumeratorIsNotPossible ( string hubProtocolName , HttpTransportType transportType , string hubPath )
1315
1248
{
1316
- bool ExpectedErrors ( WriteContext writeContext )
1317
- {
1318
- return writeContext . LoggerName == DefaultHubDispatcherLoggerName &&
1319
- writeContext . EventId . Name == "InvalidReturnValueFromStreamingMethod" ;
1320
- }
1321
-
1322
1249
var hubProtocol = HubProtocols [ hubProtocolName ] ;
1323
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1250
+ using ( StartServer < Startup > ( out var server ) )
1324
1251
{
1325
1252
var connection = CreateHubConnection ( server . Url , hubPath , transportType , hubProtocol , LoggerFactory ) ;
1326
1253
try
@@ -1345,16 +1272,11 @@ bool ExpectedErrors(WriteContext writeContext)
1345
1272
[ Fact ]
1346
1273
public async Task RandomGenericIsNotTreatedAsStream ( )
1347
1274
{
1348
- bool ExpectedErrors ( WriteContext writeContext )
1349
- {
1350
- return "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" == writeContext . LoggerName &&
1351
- "FailedInvokingHubMethod" == writeContext . EventId . Name ;
1352
- }
1353
1275
var hubPath = HubPaths [ 0 ] ;
1354
1276
var hubProtocol = HubProtocols . First ( ) . Value ;
1355
1277
var transportType = TransportTypes ( ) . First ( ) . Cast < HttpTransportType > ( ) . First ( ) ;
1356
1278
1357
- using ( StartServer < Startup > ( out var server , ExpectedErrors ) )
1279
+ using ( StartServer < Startup > ( out var server ) )
1358
1280
{
1359
1281
var connection = CreateHubConnection ( server . Url , hubPath , transportType , hubProtocol , LoggerFactory ) ;
1360
1282
await connection . StartAsync ( ) . OrTimeout ( ) ;
0 commit comments