141 references to ResponseUtils
Microsoft.AspNetCore.SignalR.Client.Tests (141)
HttpConnectionTests.ConnectionLifecycle.cs (8)
298
longPollResult.TrySetResult(
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
302
httpHandler.OnLongPollDelete(cancellationToken =>
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
307
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.InternalServerError));
337
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.InternalServerError));
363
return
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted);
398
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
521
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent());
HttpConnectionTests.cs (5)
80
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
81
ResponseUtils
.CreateNegotiationContent());
130
testHttpHandler.OnNegotiate((request, cancellationToken) =>
ResponseUtils
.CreateResponse(HttpStatusCode.BadGateway));
176
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent());
HttpConnectionTests.Negotiate.cs (42)
37
return RunInvalidNegotiateResponseTest<FormatException>(
ResponseUtils
.CreateNegotiationContent(connectionId: string.Empty), "Invalid connection id.");
43
return RunInvalidNegotiateResponseTest<InvalidDataException>(
ResponseUtils
.CreateNegotiationContent(negotiateVersion: 1, connectionToken: null), "Invalid negotiation response received.");
49
return RunInvalidNegotiateResponseTest<AggregateException>(
ResponseUtils
.CreateNegotiationContent(transportTypes: HttpTransportType.ServerSentEvents),
56
return RunInvalidNegotiateResponseTest<NoTransportSupportedException>(
ResponseUtils
.CreateNegotiationContent(transportTypes: HttpTransportType.None), "None of the transports supported by the client are supported by the server.");
71
testHttpHandler.OnLongPoll(cancellationToken =>
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
72
testHttpHandler.OnLongPollDelete(cancellationToken =>
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
76
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
77
ResponseUtils
.CreateNegotiationContent());
99
testHttpHandler.OnNegotiate((request, cancellationToken) =>
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
112
testHttpHandler.OnLongPoll(cancellationToken =>
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
113
testHttpHandler.OnLongPollDelete((token) =>
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
135
testHttpHandler.OnNegotiate((request, cancellationToken) =>
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
149
testHttpHandler.OnLongPoll(cancellationToken =>
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
150
testHttpHandler.OnLongPollDelete((token) =>
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
172
testHttpHandler.OnNegotiate((request, cancellationToken) =>
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
188
testHttpHandler.OnLongPoll(cancellationToken =>
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
189
testHttpHandler.OnLongPollDelete((token) =>
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
213
testHttpHandler.OnNegotiate((request, cancellationToken) =>
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
228
testHttpHandler.OnLongPoll(cancellationToken =>
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
229
testHttpHandler.OnLongPollDelete((token) =>
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
257
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
264
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
283
token.Register(() => tcs.TrySetResult(
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent)));
288
testHttpHandler.OnLongPollDelete((token) =>
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
313
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
346
return
ResponseUtils
.CreateResponse(HttpStatusCode.Unauthorized);
349
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
360
return
ResponseUtils
.CreateResponse(HttpStatusCode.Unauthorized);
363
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
383
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.Unauthorized));
387
token.Register(() => tcs.TrySetResult(
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent)));
392
testHttpHandler.OnLongPollDelete((token) =>
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
424
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
432
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
452
token.Register(() => tcs.TrySetResult(
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent)));
457
testHttpHandler.OnLongPollDelete((token) =>
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
484
testHttpHandler.OnLongPoll(cancellationToken =>
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
487
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
533
testHttpHandler.OnLongPoll(cancellationToken =>
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
536
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
586
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
609
testHttpHandler.OnNegotiate((_, cancellationToken) =>
ResponseUtils
.CreateResponse(HttpStatusCode.OK, negotiatePayload));
HttpConnectionTests.Transport.cs (38)
39
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent());
56
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
87
testHttpHandler.OnNegotiate((_, cancellationToken) =>
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent()));
89
testHttpHandler.OnRequest((request, next, token) => Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent)));
114
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent());
138
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
162
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent());
178
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
204
return
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent);
207
var resp =
ResponseUtils
.CreateResponse(HttpStatusCode.OK, messageFragments[requestCount]);
211
testHttpHandler.OnSocketSend((_, __) =>
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
237
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
250
longPollTcs.TrySetResult(
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent));
325
return
ResponseUtils
.CreateResponse(HttpStatusCode.Unauthorized);
354
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent());
366
return
ResponseUtils
.CreateResponse(HttpStatusCode.Unauthorized);
372
return
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent);
375
var resp =
ResponseUtils
.CreateResponse(HttpStatusCode.OK, messageFragments[pollCount / 2]);
386
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.Unauthorized));
395
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.OK));
428
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent());
433
return
ResponseUtils
.CreateResponse(HttpStatusCode.Unauthorized);
463
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent());
473
return
ResponseUtils
.CreateResponse(HttpStatusCode.Unauthorized);
476
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
486
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.Unauthorized));
493
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.OK, new StreamContent(stream)));
524
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent());
529
return
ResponseUtils
.CreateResponse(HttpStatusCode.Unauthorized);
536
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.OK, new StreamContent(stream)));
LongPollingTransportTests.cs (34)
39
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
74
return
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent);
112
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
117
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK, "Hello");
123
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
128
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK, "World");
132
return
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent);
163
return
ResponseUtils
.CreateResponse(HttpStatusCode.InternalServerError);
194
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
196
return
ResponseUtils
.CreateResponse(HttpStatusCode.InternalServerError);
240
return
ResponseUtils
.CreateResponse(HttpStatusCode.NotFound);
247
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
251
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
286
return
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted);
288
return
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent);
290
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
292
return
ResponseUtils
.CreateResponse(HttpStatusCode.InternalServerError);
334
return
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted);
339
?
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent)
340
:
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
373
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
416
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
421
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK, message1Payload);
424
return
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent);
478
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
487
return
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted);
489
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
546
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
560
return
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted);
562
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
591
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
620
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
650
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
659
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
SendUtilsTests.cs (2)
26
responseTaskCompletionSource.SetResult(
ResponseUtils
.CreateResponse(HttpStatusCode.OK));
30
responseTaskCompletionSource.SetResult(
ResponseUtils
.CreateResponse(HttpStatusCode.BadRequest));
ServerSentEventsTransportTests.cs (1)
200
return
ResponseUtils
.CreateResponse(System.Net.HttpStatusCode.InternalServerError);
TestHttpMessageHandler.cs (11)
44
OnNegotiate((_, cancellationToken) =>
ResponseUtils
.CreateResponse(HttpStatusCode.OK,
ResponseUtils
.CreateNegotiationContent()));
53
if (
ResponseUtils
.IsLongPollRequest(request) && firstPoll)
56
return
ResponseUtils
.CreateResponse(HttpStatusCode.OK);
108
testHttpMessageHandler.OnSocketSend((_, __) =>
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
119
return
ResponseUtils
.CreateResponse(HttpStatusCode.NoContent);
126
return Task.FromResult(
ResponseUtils
.CreateResponse(HttpStatusCode.Accepted));
181
if (
ResponseUtils
.IsNegotiateRequest(request))
198
if (
ResponseUtils
.IsLongPollDeleteRequest(request))
225
if (
ResponseUtils
.IsLongPollRequest(request))
242
if (
ResponseUtils
.IsSocketSendRequest(request))