10 instantiations of CompletionMessage
Microsoft.AspNetCore.Components.Server (1)
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
210
return ApplyHeaders(headers, new
CompletionMessage
(invocationId, error, result, hasResult));
Microsoft.AspNetCore.SignalR.Common (3)
Protocol\CompletionMessage.cs (3)
66
=> new
CompletionMessage
(invocationId, error, result: null, hasResult: false);
75
=> new
CompletionMessage
(invocationId, error: null, result: payload, hasResult: true);
84
=> new
CompletionMessage
(invocationId, error: null, result: null, hasResult: false);
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Internal\Protocol\JsonHubProtocolTestsBase.cs (1)
106
new JsonProtocolTestData("CompletionMessage_ResultFirst", new
CompletionMessage
("15", null, 10, hasResult: true), false, true, "{ \"type\":3, \"result\": 10, \"invocationId\": \"15\" }"),
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Protocol\JsonHubProtocol.cs (2)
752
return new
CompletionMessage
(invocationId, error, result, hasResult: true);
755
return new
CompletionMessage
(invocationId, error, result: null, hasResult: false);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Protocol\MessagePackHubProtocolWorker.cs (1)
210
return ApplyHeaders(headers, new
CompletionMessage
(invocationId, error, result, hasResult));
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
Protocol\NewtonsoftJsonHubProtocol.cs (2)
745
return new
CompletionMessage
(invocationId, error, result, hasResult: true);
748
return new
CompletionMessage
(invocationId, error, result: null, hasResult: false);
357 references to CompletionMessage
Microsoft.AspNetCore.Components.Server (3)
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (3)
159
private
CompletionMessage
CreateCompletionMessage(ref MessagePackReader reader, IInvocationBinder binder)
400
case
CompletionMessage
completionMessage:
525
private void WriteCompletionMessage(
CompletionMessage
message, ref MessagePackWriter writer)
Microsoft.AspNetCore.Components.Server.Tests (16)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (11)
113
message:
CompletionMessage
.WithError("xyz", error: "Error not found!"),
117
message: AddHeaders(TestHeaders,
CompletionMessage
.WithError("xyz", error: "Error not found!")),
121
message:
CompletionMessage
.Empty("xyz"),
125
message: AddHeaders(TestHeaders,
CompletionMessage
.Empty("xyz")),
129
message:
CompletionMessage
.WithResult("xyz", payload: 42),
133
message:
CompletionMessage
.WithResult("xyz", payload: 42.0f),
137
message:
CompletionMessage
.WithResult("xyz", payload: "string"),
141
message:
CompletionMessage
.WithResult("xyz", payload: true),
424
new MessageSizeTestData("CompletionMessage_Empty",
CompletionMessage
.Empty("1"), 7),
425
new MessageSizeTestData("CompletionMessage_WithResult",
CompletionMessage
.WithResult("1", 1), 8),
426
new MessageSizeTestData("CompletionMessage_WithError",
CompletionMessage
.WithError("1", "error"), 13),
src\SignalR\common\SignalR.Common\test\Internal\Protocol\TestBinder.cs (1)
29
case
CompletionMessage
c:
src\SignalR\common\SignalR.Common\test\Internal\Protocol\TestHubMessageEqualityComparer.cs (4)
31
case
CompletionMessage
completionMessage:
32
return CompletionMessagesEqual(completionMessage, (
CompletionMessage
)y);
51
private bool CompletionMessagesEqual(
CompletionMessage
x,
CompletionMessage
y)
Microsoft.AspNetCore.SignalR.Client.Core (11)
HubConnection.cs (8)
998
await SendHubMessage(connectionState,
CompletionMessage
.WithError(streamId, responseError), cancellationToken: default).ConfigureAwait(false);
1301
await SendWithLock(connectionState,
CompletionMessage
.WithError(bindingFailure.InvocationId, "Client failed to parse argument(s)."), cancellationToken: default).ConfigureAwait(false);
1308
case
CompletionMessage
completion:
1375
await SendWithLock(connectionState,
CompletionMessage
.WithError(invocation.InvocationId!, "Client didn't provide a result."), cancellationToken: default).ConfigureAwait(false);
1425
await SendWithLock(connectionState,
CompletionMessage
.WithError(invocation.InvocationId!, resultException.Message), cancellationToken: default).ConfigureAwait(false);
1429
await SendWithLock(connectionState,
CompletionMessage
.WithResult(invocation.InvocationId!, result), cancellationToken: default).ConfigureAwait(false);
1434
await SendWithLock(connectionState,
CompletionMessage
.WithError(invocation.InvocationId!, "Client didn't provide a result."), cancellationToken: default).ConfigureAwait(false);
1462
private void DispatchInvocationCompletion(
CompletionMessage
completion, InvocationRequest irq)
Internal\InvocationRequest.cs (3)
64
public abstract void Complete(
CompletionMessage
message);
90
public override void Complete(
CompletionMessage
completionMessage)
178
public override void Complete(
CompletionMessage
completionMessage)
Microsoft.AspNetCore.SignalR.Common (11)
Protocol\CompletionMessage.cs (10)
30
/// Constructs a <see cref="
CompletionMessage
"/>.
60
/// Constructs a <see cref="
CompletionMessage
"/> with an error.
64
/// <returns>The constructed <see cref="
CompletionMessage
"/>.</returns>
65
public static
CompletionMessage
WithError(string invocationId, string? error)
69
/// Constructs a <see cref="
CompletionMessage
"/> with a result.
73
/// <returns>The constructed <see cref="
CompletionMessage
"/>.</returns>
74
public static
CompletionMessage
WithResult(string invocationId, object? payload)
78
/// Constructs a <see cref="
CompletionMessage
"/> without an error or result.
82
/// <returns>The constructed <see cref="
CompletionMessage
"/>.</returns>
83
public static
CompletionMessage
Empty(string invocationId)
Protocol\RawResult.cs (1)
23
/// Stores the raw serialized bytes of a <see cref="
CompletionMessage
.Result"/> for forwarding to another server.
Microsoft.AspNetCore.SignalR.Common.Tests (66)
Internal\Protocol\CompositeTestBinder.cs (1)
35
return arg is
CompletionMessage
||
Internal\Protocol\JsonHubProtocolTests.cs (4)
190
JsonHubProtocol.WriteMessage(
CompletionMessage
.WithResult("1", todo), writer);
199
var
completionMessage = Assert.IsType<
CompletionMessage
>(message);
217
new JsonProtocolTestData("CompletionMessage_HasFloatResult",
CompletionMessage
.WithResult("123", 2.0f), true, true, "{\"type\":3,\"invocationId\":\"123\",\"result\":2}"),
Internal\Protocol\JsonHubProtocolTestsBase.cs (25)
56
new JsonProtocolTestData("CompletionMessage_HasCustomResultWithNoCamelCase",
CompletionMessage
.WithResult("123", new CustomObject()), false, true, "{\"type\":3,\"invocationId\":\"123\",\"result\":{\"StringProp\":\"SignalR!\",\"DoubleProp\":6.2831853071,\"IntProp\":42,\"DateTimeProp\":\"2017-04-11T00:00:00Z\",\"ByteArrProp\":\"AQID\"}}"),
57
new JsonProtocolTestData("CompletionMessage_HasCustomResultWithNullValueIgnore",
CompletionMessage
.WithResult("123", new CustomObject()), true, true, "{\"type\":3,\"invocationId\":\"123\",\"result\":{\"stringProp\":\"SignalR!\",\"doubleProp\":6.2831853071,\"intProp\":42,\"dateTimeProp\":\"2017-04-11T00:00:00Z\",\"byteArrProp\":\"AQID\"}}"),
58
new JsonProtocolTestData("CompletionMessage_HasCustomResultWithNullValueIncludeAndNoCamelCase",
CompletionMessage
.WithResult("123", new CustomObject()), false, false, "{\"type\":3,\"invocationId\":\"123\",\"result\":{\"StringProp\":\"SignalR!\",\"DoubleProp\":6.2831853071,\"IntProp\":42,\"DateTimeProp\":\"2017-04-11T00:00:00Z\",\"NullProp\":null,\"ByteArrProp\":\"AQID\"}}"),
59
new JsonProtocolTestData("CompletionMessage_HasCustomResultWithNullValueInclude",
CompletionMessage
.WithResult("123", new CustomObject()), true, false, "{\"type\":3,\"invocationId\":\"123\",\"result\":{\"stringProp\":\"SignalR!\",\"doubleProp\":6.2831853071,\"intProp\":42,\"dateTimeProp\":\"2017-04-11T00:00:00Z\",\"nullProp\":null,\"byteArrProp\":\"AQID\"}}"),
60
new JsonProtocolTestData("CompletionMessage_HasErrorAndCamelCase",
CompletionMessage
.Empty("123"), true, true, "{\"type\":3,\"invocationId\":\"123\"}"),
61
new JsonProtocolTestData("CompletionMessage_HasTestHeadersAndCustomItemResult", AddHeaders(TestHeaders,
CompletionMessage
.WithResult("123", new CustomObject())), true, false, "{\"type\":3," + SerializedHeaders + ",\"invocationId\":\"123\",\"result\":{\"stringProp\":\"SignalR!\",\"doubleProp\":6.2831853071,\"intProp\":42,\"dateTimeProp\":\"2017-04-11T00:00:00Z\",\"nullProp\":null,\"byteArrProp\":\"AQID\"}}"),
62
new JsonProtocolTestData("CompletionMessage_HasErrorAndHeadersAndCamelCase", AddHeaders(TestHeaders,
CompletionMessage
.Empty("123")), true, true, "{\"type\":3," + SerializedHeaders + ",\"invocationId\":\"123\"}"),
63
new JsonProtocolTestData("CompletionMessage_HasIntegerResult",
CompletionMessage
.WithResult("123", 1), true, true, "{\"type\":3,\"invocationId\":\"123\",\"result\":1}"),
64
new JsonProtocolTestData("CompletionMessage_HasStringResult",
CompletionMessage
.WithResult("123", "Foo"), true, true, "{\"type\":3,\"invocationId\":\"123\",\"result\":\"Foo\"}"),
65
new JsonProtocolTestData("CompletionMessage_HasBoolResult",
CompletionMessage
.WithResult("123", true), true, true, "{\"type\":3,\"invocationId\":\"123\",\"result\":true}"),
66
new JsonProtocolTestData("CompletionMessage_HasNullResult",
CompletionMessage
.WithResult("123", null), true, true, "{\"type\":3,\"invocationId\":\"123\",\"result\":null}"),
67
new JsonProtocolTestData("CompletionMessage_HasError",
CompletionMessage
.WithError("123", "Whoops!"), true, true, "{\"type\":3,\"invocationId\":\"123\",\"error\":\"Whoops!\"}"),
68
new JsonProtocolTestData("CompletionMessage_HasErrorAndHeaders", AddHeaders(TestHeaders,
CompletionMessage
.WithError("123", "Whoops!")), true, true, "{\"type\":3," + SerializedHeaders + ",\"invocationId\":\"123\",\"error\":\"Whoops!\"}"),
296
var
invocationMessage = Assert.IsType<
CompletionMessage
>(message);
372
new MessageSizeTestData("CompletionMessage_Empty",
CompletionMessage
.Empty("1"), 30),
373
new MessageSizeTestData("CompletionMessage_WithResult",
CompletionMessage
.WithResult("1", 1), 41),
374
new MessageSizeTestData("CompletionMessage_WithError",
CompletionMessage
.WithError("1", "error"), 46),
443
var
completion = Assert.IsType<
CompletionMessage
>(message);
457
completion = Assert.IsType<
CompletionMessage
>(message);
476
var
completion = Assert.IsType<
CompletionMessage
>(hubMessage);
492
var
completion = Assert.IsType<
CompletionMessage
>(hubMessage);
Internal\Protocol\MessagePackHubProtocolTestBase.cs (11)
113
message:
CompletionMessage
.WithError("xyz", error: "Error not found!"),
117
message: AddHeaders(TestHeaders,
CompletionMessage
.WithError("xyz", error: "Error not found!")),
121
message:
CompletionMessage
.Empty("xyz"),
125
message: AddHeaders(TestHeaders,
CompletionMessage
.Empty("xyz")),
129
message:
CompletionMessage
.WithResult("xyz", payload: 42),
133
message:
CompletionMessage
.WithResult("xyz", payload: 42.0f),
137
message:
CompletionMessage
.WithResult("xyz", payload: "string"),
141
message:
CompletionMessage
.WithResult("xyz", payload: true),
424
new MessageSizeTestData("CompletionMessage_Empty",
CompletionMessage
.Empty("1"), 7),
425
new MessageSizeTestData("CompletionMessage_WithResult",
CompletionMessage
.WithResult("1", 1), 8),
426
new MessageSizeTestData("CompletionMessage_WithError",
CompletionMessage
.WithError("1", "error"), 13),
Internal\Protocol\MessagePackHubProtocolTests.cs (19)
19
var result = Write(
CompletionMessage
.WithResult("0", new List<int> { 42 }.AsReadOnly()));
36
HubProtocol.WriteMessage(
CompletionMessage
.WithResult("xyz", originalDateTime), writer);
40
var
completionMessage = Assert.IsType<
CompletionMessage
>(hubMessage);
65
HubProtocol.WriteMessage(
CompletionMessage
.WithResult("xyz", dateTimeOffset), writer);
69
var
completionMessage = Assert.IsType<
CompletionMessage
>(hubMessage);
97
message:
CompletionMessage
.WithResult("xyz", payload: null),
101
message:
CompletionMessage
.WithResult("xyz", payload: new CustomObject()),
105
message:
CompletionMessage
.WithResult("xyz", payload: new[] { new CustomObject(), new CustomObject() }),
109
message: AddHeaders(TestHeaders,
CompletionMessage
.WithResult("xyz", payload: new[] { new CustomObject(), new CustomObject() })),
113
message:
CompletionMessage
.WithResult("xyz", payload: TestEnum.One),
223
var
completion = Assert.IsType<
CompletionMessage
>(message);
237
completion = Assert.IsType<
CompletionMessage
>(message);
254
var
completion = Assert.IsType<
CompletionMessage
>(hubMessage);
267
var
completion = Assert.IsType<
CompletionMessage
>(hubMessage);
Internal\Protocol\NewtonsoftJsonHubProtocolTests.cs (1)
103
new JsonProtocolTestData("CompletionMessage_HasFloatResult",
CompletionMessage
.WithResult("123", 2.0f), true, true, "{\"type\":3,\"invocationId\":\"123\",\"result\":2.0}"),
Internal\Protocol\TestBinder.cs (1)
29
case
CompletionMessage
c:
Internal\Protocol\TestHubMessageEqualityComparer.cs (4)
31
case
CompletionMessage
completionMessage:
32
return CompletionMessagesEqual(completionMessage, (
CompletionMessage
)y);
51
private bool CompletionMessagesEqual(
CompletionMessage
x,
CompletionMessage
y)
Microsoft.AspNetCore.SignalR.Core (21)
DefaultHubLifetimeManager.cs (1)
384
public override Task SetConnectionResultAsync(string connectionId,
CompletionMessage
result)
HubLifetimeManager.cs (1)
158
public virtual Task SetConnectionResultAsync(string connectionId,
CompletionMessage
result)
Internal\DefaultHubDispatcher.cs (10)
205
case
CompletionMessage
completionMessage:
260
var
message =
CompletionMessage
.WithError(bindingFailureMessage.Id, errorString);
292
return connection.WriteAsync(
CompletionMessage
.WithError(
445
await connection.WriteAsync(
CompletionMessage
.WithResult(hubMethodInvocationMessage.InvocationId, result));
499
connection.StreamTracker.TryComplete(
CompletionMessage
.Empty(stream));
602
await connection.WriteAsync(
CompletionMessage
.WithError(invocationId, error));
655
await connection.WriteAsync(
CompletionMessage
.WithError(invocationId, errorMessage));
699
await connection.WriteAsync(
CompletionMessage
.WithError(hubMethodInvocationMessage.InvocationId,
709
await connection.WriteAsync(
CompletionMessage
.WithError(hubMethodInvocationMessage.InvocationId!,
Internal\DefaultHubDispatcherLog.cs (2)
83
public static void CompletingStream(ILogger logger,
CompletionMessage
message)
89
public static void ClosingStreamWithBindingError(ILogger logger,
CompletionMessage
message)
src\SignalR\common\Shared\ClientResultsManager.cs (6)
16
private readonly ConcurrentDictionary<string, (Type Type, string ConnectionId, object Tcs, Action<object,
CompletionMessage
> Complete)> _pendingInvocations = new();
41
public void AddInvocation(string invocationId, (Type Type, string ConnectionId, object Tcs, Action<object,
CompletionMessage
> Complete) invocationInfo)
48
invocationInfo.Complete(invocationInfo.Tcs,
CompletionMessage
.WithError(invocationId, "ID collision occurred when using client results. This is likely a bug in SignalR."));
52
public void TryCompleteResult(string connectionId,
CompletionMessage
message)
75
public (Type Type, string ConnectionId, object Tcs, Action<object,
CompletionMessage
> Completion)? RemoveInvocation(string invocationId)
152
_clientResultsManager.TryCompleteResult(_connectionId,
CompletionMessage
.WithError(_invocationId, "Invocation canceled by the server."));
StreamTracker.cs (1)
74
public bool TryComplete(
CompletionMessage
message)
Microsoft.AspNetCore.SignalR.Microbenchmarks (6)
DefaultHubDispatcherBenchmark.cs (5)
94
if (message is
CompletionMessage
completionMessage)
346
await _dispatcher.DispatchMessageAsync(_connectionContext,
CompletionMessage
.Empty("1"));
357
await _dispatcher.DispatchMessageAsync(_connectionContext,
CompletionMessage
.Empty("1"));
371
await _dispatcher.DispatchMessageAsync(_connectionContext,
CompletionMessage
.Empty("1"));
385
await _dispatcher.DispatchMessageAsync(_connectionContext,
CompletionMessage
.Empty("1"));
TestBinder.cs (1)
26
case
CompletionMessage
c:
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Protocol\JsonHubProtocol.cs (2)
541
case
CompletionMessage
m:
592
private void WriteCompletionMessage(
CompletionMessage
message, Utf8JsonWriter writer)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (3)
Protocol\MessagePackHubProtocolWorker.cs (3)
159
private
CompletionMessage
CreateCompletionMessage(ref MessagePackReader reader, IInvocationBinder binder)
400
case
CompletionMessage
completionMessage:
525
private void WriteCompletionMessage(
CompletionMessage
message, ref MessagePackWriter writer)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
Protocol\NewtonsoftJsonHubProtocol.cs (2)
538
case
CompletionMessage
m:
591
private void WriteCompletionMessage(
CompletionMessage
message, JsonTextWriter writer)
Microsoft.AspNetCore.SignalR.Specification.Tests (15)
HubLifetimeManagerTestBase.cs (7)
194
await manager.SetConnectionResultAsync(connection1.ConnectionId,
CompletionMessage
.WithResult(invocation.InvocationId, 10)).DefaultTimeout();
221
await manager.SetConnectionResultAsync(connection1.ConnectionId,
CompletionMessage
.WithError(invocation.InvocationId, "Error from client")).DefaultTimeout();
252
manager.SetConnectionResultAsync(connection2.ConnectionId,
CompletionMessage
.WithError(invocation.InvocationId, "Error from client"))).DefaultTimeout();
257
await manager.SetConnectionResultAsync(connection1.ConnectionId,
CompletionMessage
.WithResult(invocation.InvocationId, 10)).DefaultTimeout();
307
await manager1.SetConnectionResultAsync(connection2.ConnectionId,
CompletionMessage
.WithError(invocation2.InvocationId, "error"));
312
await manager1.SetConnectionResultAsync(connection1.ConnectionId,
CompletionMessage
.WithResult(invocation1.InvocationId, 3));
365
await manager1.SetConnectionResultAsync(connection1.ConnectionId,
CompletionMessage
.WithResult(invocation1.InvocationId, 1));
ScaleoutHubLifetimeManagerTests.cs (5)
491
await manager1.SetConnectionResultAsync(connection1.ConnectionId,
CompletionMessage
.WithResult(invocation.InvocationId, 10)).DefaultTimeout();
522
await manager1.SetConnectionResultAsync(connection1.ConnectionId,
CompletionMessage
.WithError(invocation.InvocationId, "Error from client")).DefaultTimeout();
605
await manager1.SetConnectionResultAsync(connection.ConnectionId,
CompletionMessage
.WithResult(invocation2.InvocationId, 2)).DefaultTimeout();
606
await manager2.SetConnectionResultAsync(connection.ConnectionId,
CompletionMessage
.WithResult(invocation1.InvocationId, 5)).DefaultTimeout();
654
await manager1.SetConnectionResultAsync(connection1.ConnectionId,
CompletionMessage
.WithResult(invocation.InvocationId, "wrong type")).DefaultTimeout();
src\SignalR\common\testassets\Tests.Utils\TestClient.cs (3)
139
case
CompletionMessage
_:
149
public async Task<
CompletionMessage
> InvokeAsync(string methodName, params object[] args)
171
case
CompletionMessage
completion:
Microsoft.AspNetCore.SignalR.StackExchangeRedis (12)
RedisHubLifetimeManager.cs (6)
437
public override Task SetConnectionResultAsync(string connectionId,
CompletionMessage
result)
573
invocationInfo?.Completion(null!,
CompletionMessage
.WithError(invocation.InvocationId, "Connection disconnected."));
701
var invocationInfo = _clientResultsManager.RemoveInvocation(((
CompletionMessage
)hubMessage!).InvocationId!);
705
hubMessage =
CompletionMessage
.WithError(((
CompletionMessage
)hubMessage!).InvocationId!, $"Client result wasn't deserializable to {invocationInfo?.Type.Name}.");
708
invocationInfo?.Completion(invocationInfo?.Tcs!, (
CompletionMessage
)hubMessage!);
src\SignalR\common\Shared\ClientResultsManager.cs (6)
16
private readonly ConcurrentDictionary<string, (Type Type, string ConnectionId, object Tcs, Action<object,
CompletionMessage
> Complete)> _pendingInvocations = new();
41
public void AddInvocation(string invocationId, (Type Type, string ConnectionId, object Tcs, Action<object,
CompletionMessage
> Complete) invocationInfo)
48
invocationInfo.Complete(invocationInfo.Tcs,
CompletionMessage
.WithError(invocationId, "ID collision occurred when using client results. This is likely a bug in SignalR."));
52
public void TryCompleteResult(string connectionId,
CompletionMessage
message)
75
public (Type Type, string ConnectionId, object Tcs, Action<object,
CompletionMessage
> Completion)? RemoveInvocation(string invocationId)
152
_clientResultsManager.TryCompleteResult(_connectionId,
CompletionMessage
.WithError(_invocationId, "Invocation canceled by the server."));
Microsoft.AspNetCore.SignalR.Tests (186)
HubConnectionHandlerTests.Activity.cs (6)
59
var
completionMessage = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
67
Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
73
Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
141
var
completionMessage = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
HubConnectionHandlerTests.ClientResult.cs (31)
31
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout();
33
var
completion = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
63
await client.SendHubMessageAsync(
CompletionMessage
.WithError(invocationMessage.InvocationId, "Client error")).DefaultTimeout();
65
var
completion = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
155
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocation.InvocationId, 2)).DefaultTimeout();
189
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocation.InvocationId, 2)).DefaultTimeout();
220
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout();
223
var
completion = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
261
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout();
262
var
completion = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
267
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocationMessage2.InvocationId, res)).DefaultTimeout();
268
completion = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
273
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocationMessage3.InvocationId, res)).DefaultTimeout();
274
completion = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
297
var
completionMessage = await client.InvokeAsync(nameof(MethodHub.BackgroundClientResult)).DefaultTimeout();
310
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout();
388
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocation.InvocationId, 2)).DefaultTimeout();
392
var
completion = await client.InvokeAsync(nameof(HubT.Echo), "test").DefaultTimeout();
433
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocation.InvocationId, 2)).DefaultTimeout();
437
var
completion = await client.InvokeAsync("Echo", "test").DefaultTimeout();
468
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout();
470
var
completion = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
475
var
completionMessage = await client.InvokeAsync(nameof(MethodHub.ValueMethod)).DefaultTimeout();
503
await client.SendHubMessageAsync(
CompletionMessage
.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout();
509
var
completionMessage = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
HubConnectionHandlerTests.cs (124)
79
var
result = (await client.InvokeAsync(nameof(HubWithAsyncDisposable.Test)).DefaultTimeout());
405
var
completionMessage = await task.DefaultTimeout() as
CompletionMessage
;
443
var
completionMessage = await client.ReadAsync() as
CompletionMessage
;
560
var
completionMessage = await client.ReadAsync().DefaultTimeout() as
CompletionMessage
;
565
completionMessage = await client.ReadAsync().DefaultTimeout() as
CompletionMessage
;
611
var
completionMessage = await client.ReadAsync().DefaultTimeout() as
CompletionMessage
;
616
completionMessage = await client.ReadAsync().DefaultTimeout() as
CompletionMessage
;
621
completionMessage = await client.ReadAsync().DefaultTimeout() as
CompletionMessage
;
928
var
message = await client.InvokeAsync(methodName).DefaultTimeout();
997
var
message = await client.InvokeAsync(methodName).DefaultTimeout();
1240
var
result = await client.InvokeAsync(nameof(MethodHub.OnDisconnectedAsync)).DefaultTimeout();
1284
var
result = await client.InvokeAsync(nameof(MethodHub.StaticMethod)).DefaultTimeout();
1309
var
result = await client.InvokeAsync(nameof(MethodHub.ToString)).DefaultTimeout();
1342
var
result = await client.InvokeAsync(nameof(MethodHub.Dispose)).DefaultTimeout();
1467
var
completion = Assert.IsType<
CompletionMessage
>(firstClientResult);
1628
Assert.IsType<
CompletionMessage
>(hubMessage);
1673
Assert.IsType<
CompletionMessage
>(hubMessage);
1770
Assert.IsType<
CompletionMessage
>(hubMessage);
1821
Assert.IsType<
CompletionMessage
>(hubMessage);
2030
HubConnectionHandlerTestUtils.AssertHubMessage(
CompletionMessage
.Empty(string.Empty), messages[4]);
2059
var
hubMessage = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
2105
var
completion = messages[0] as
CompletionMessage
;
2213
var
message = await client.InvokeAsync(nameof(MethodHub.AuthMethod)).DefaultTimeout();
2250
var
message = await client.InvokeAsync(nameof(MethodHub.AuthMethod)).DefaultTimeout();
2358
var
message = await client.InvokeAsync(nameof(MethodHub.MultiParamAuthMethod), "Hello", "World!").DefaultTimeout();
2575
Assert.IsType<
CompletionMessage
>(client2.TryRead());
2680
var
completion = await client.InvokeAsync(nameof(MethodHub.ValueMethod)).DefaultTimeout();
2925
Assert.IsType<
CompletionMessage
>(result);
3192
var
completion = await client.InvokeAsync(nameof(StreamingHub.NonStream)).DefaultTimeout();
3229
var
completion = messages[0] as
CompletionMessage
;
3264
var
completion = messages[0] as
CompletionMessage
;
3300
var
completion = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
3353
var
longRunningCompletion = Assert.IsType<
CompletionMessage
>(firstResult);
3359
var
simpleCompletion = Assert.IsType<
CompletionMessage
>(secondResult);
3405
var
simpleCompletion = Assert.IsType<
CompletionMessage
>(secondResult);
3415
var
longRunningCompletion = Assert.IsType<
CompletionMessage
>(firstResult);
3472
var
longRunningCompletion = Assert.IsType<
CompletionMessage
>(firstResult);
3478
var
simpleCompletion = Assert.IsType<
CompletionMessage
>(secondResult);
3485
longRunningCompletion = Assert.IsType<
CompletionMessage
>(firstResult);
3525
var
completion = await client.InvokeAsync(nameof(LongRunningHub.SimpleMethod)).DefaultTimeout();
3537
completion = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
3612
var
result = (
CompletionMessage
)await client.ReadAsync().DefaultTimeout(5000);
3633
await client.SendHubMessageAsync(
CompletionMessage
.Empty("id")).DefaultTimeout();
3634
var
result = (
CompletionMessage
)await client.ReadAsync().DefaultTimeout();
3657
await client.SendHubMessageAsync(
CompletionMessage
.Empty("id")).DefaultTimeout();
3658
var
response = (
CompletionMessage
)await client.ReadAsync().DefaultTimeout();
3696
await client.SendHubMessageAsync(
CompletionMessage
.Empty(id)).DefaultTimeout();
3699
Assert.Equal(words[int.Parse(id, CultureInfo.InvariantCulture)], ((
CompletionMessage
)response).Result);
3752
await client.SendHubMessageAsync(
CompletionMessage
.Empty("id")).DefaultTimeout();
3753
var
response = (
CompletionMessage
)await client.ReadAsync().DefaultTimeout();
3780
var
completion = await client.InvokeAsync(nameof(LongRunningHub.SimpleMethod)).DefaultTimeout();
3784
await client.SendHubMessageAsync(
CompletionMessage
.Empty("id")).DefaultTimeout();
3787
var
response = (
CompletionMessage
)await client.ReadAsync().DefaultTimeout();
3879
await client.SendHubMessageAsync(
CompletionMessage
.Empty("id")).DefaultTimeout();
3880
var
response = (
CompletionMessage
)await client.ReadAsync().DefaultTimeout();
3931
Assert.Equal(typeof(
CompletionMessage
), response.GetType());
3932
Assert.Equal("error identified and caught", (string)((
CompletionMessage
)response).Result);
3976
await client.SendHubMessageAsync(
CompletionMessage
.Empty("fake_id")).DefaultTimeout();
4001
await client.SendHubMessageAsync(
CompletionMessage
.WithError("id", CustomErrorMessage)).DefaultTimeout();
4003
var
response = (
CompletionMessage
)await client.ReadAsync().DefaultTimeout();
4022
var
response = (
CompletionMessage
)await client.ReadAsync().DefaultTimeout();
4041
var
response = (
CompletionMessage
)await client.ReadAsync().DefaultTimeout();
4066
await client.SendHubMessageAsync(
CompletionMessage
.Empty("id")).DefaultTimeout();
4069
var
simpleCompletion = Assert.IsType<
CompletionMessage
>(result);
4110
await client.SendHubMessageAsync(
CompletionMessage
.Empty("id")).DefaultTimeout();
4142
var
simpleCompletion = Assert.IsType<
CompletionMessage
>(result);
4179
var
simpleCompletion = Assert.IsType<
CompletionMessage
>(result);
4229
var
simpleCompletion = Assert.IsType<
CompletionMessage
>(result);
4392
var
completion = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
4428
await client.SendHubMessageAsync(
CompletionMessage
.Empty(streamId));
4494
HubConnectionHandlerTestUtils.AssertHubMessage(
CompletionMessage
.Empty(string.Empty), messages[1]);
4661
var
res = await client.InvokeAsync(nameof(ServicesHub.SingleService)).DefaultTimeout();
4678
var
res = await client.InvokeAsync(nameof(ServicesHub.SingleService)).DefaultTimeout();
4697
var
res = await client.InvokeAsync(nameof(ServicesHub.MultipleServices)).DefaultTimeout();
4721
await client.SendHubMessageAsync(
CompletionMessage
.Empty("1")).DefaultTimeout();
4723
var
response = Assert.IsType<
CompletionMessage
>(await client.ReadAsync().DefaultTimeout());
4741
var
res = await client.InvokeAsync(nameof(ServicesHub.Stream)).DefaultTimeout();
4763
var
res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithoutAttribute)).DefaultTimeout();
4784
var
res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithoutAttribute)).DefaultTimeout();
4805
var
res = await client.InvokeAsync(nameof(ServicesHub.IEnumerableOfServiceWithoutAttribute)).DefaultTimeout();
4830
var
res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithoutAttribute)).DefaultTimeout();
4853
var
res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithAndWithoutAttribute)).DefaultTimeout();
4875
var
res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithAndWithoutAttribute)).DefaultTimeout();
4895
var
res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithoutAttribute)).DefaultTimeout();
4915
var
res = await client.InvokeAsync(nameof(ServicesHub.IEnumerableOfServiceWithoutAttribute)).DefaultTimeout();
4938
var
res = await client.InvokeAsync(nameof(KeyedServicesHub.KeyedService)).DefaultTimeout();
4961
var
res = await client.InvokeAsync(nameof(KeyedServicesHub.KeyedServiceWithParam), 91).DefaultTimeout();
4985
var
res = await client.InvokeAsync(nameof(KeyedServicesHub.KeyedServiceNonKeyedService)).DefaultTimeout();
5008
var
res = await client.InvokeAsync(nameof(KeyedServicesHub.MultipleKeyedServices)).DefaultTimeout();
5031
var
res = await client.InvokeAsync(nameof(KeyedServicesHub.MultipleSameKeyedServices)).DefaultTimeout();
5183
var
completionMessage = await client.InvokeAsync(nameof(MethodHub.Echo), new object[] { "test" });
5220
var
completionMessage = Assert.IsType<
CompletionMessage
>(await readTask);
HubConnectionHandlerTestUtils\Utils.cs (3)
32
case
CompletionMessage
expectedCompletion:
33
var
actualCompletion = Assert.IsType<
CompletionMessage
>(actual);
HubFilterTests.cs (18)
125
var
message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout();
161
var
completion = await client.InvokeAsync(nameof(DynamicTestHub.Echo), "hello");
202
var
message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout();
252
var
message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout();
303
var
message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout();
361
var
message = await invokeTask.DefaultTimeout();
421
var
message = await invokeTask.DefaultTimeout();
483
var
message = await invokeTask.DefaultTimeout();
551
var
message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout();
599
var
message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout();
638
var
message = await client.InvokeAsync("Method");
669
var
message = await client.InvokeAsync("Method");
700
var
message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout();
739
var
message = await client.InvokeAsync("Echo", "Hello");
776
var
message = await client.InvokeAsync("Echo", "Hello");
815
var
message = await client.InvokeAsync("Echo", "Hello");
852
var
message = await client.InvokeAsync("Echo", "Hello");
890
var
message = await client.InvokeAsync("Echo", "Hello");
Internal\MessageBufferTests.cs (4)
146
Assert.True(messageBuffer.ShouldProcessMessage(
CompletionMessage
.WithResult("1", null)));
169
Assert.False(messageBuffer.ShouldProcessMessage(
CompletionMessage
.WithResult("1", null)));
205
await messageBuffer.WriteAsync(
CompletionMessage
.WithResult("1", null), default);
211
Assert.IsType<
CompletionMessage
>(message);
Microsoft.AspNetCore.SignalR.Tests.Utils (3)
TestClient.cs (3)
139
case
CompletionMessage
_:
149
public async Task<
CompletionMessage
> InvokeAsync(string methodName, params object[] args)
171
case
CompletionMessage
completion: