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