56 references to WithResult
Microsoft.AspNetCore.Components.Server.Tests (5)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (5)
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),
425
new MessageSizeTestData("CompletionMessage_WithResult", CompletionMessage.
WithResult
("1", 1), 8),
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
1429
await SendWithLock(connectionState, CompletionMessage.
WithResult
(invocation.InvocationId!, result), cancellationToken: default).ConfigureAwait(false);
Microsoft.AspNetCore.SignalR.Common.Tests (26)
Internal\Protocol\JsonHubProtocolTests.cs (2)
190
JsonHubProtocol.WriteMessage(CompletionMessage.
WithResult
("1", todo), writer);
217
new JsonProtocolTestData("CompletionMessage_HasFloatResult", CompletionMessage.
WithResult
("123", 2.0f), true, true, "{\"type\":3,\"invocationId\":\"123\",\"result\":2}"),
Internal\Protocol\JsonHubProtocolTestsBase.cs (10)
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\"}}"),
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\"}}"),
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}"),
373
new MessageSizeTestData("CompletionMessage_WithResult", CompletionMessage.
WithResult
("1", 1), 41),
Internal\Protocol\MessagePackHubProtocolTestBase.cs (5)
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),
425
new MessageSizeTestData("CompletionMessage_WithResult", CompletionMessage.
WithResult
("1", 1), 8),
Internal\Protocol\MessagePackHubProtocolTests.cs (8)
19
var result = Write(CompletionMessage.
WithResult
("0", new List<int> { 42 }.AsReadOnly()));
36
HubProtocol.WriteMessage(CompletionMessage.
WithResult
("xyz", originalDateTime), writer);
65
HubProtocol.WriteMessage(CompletionMessage.
WithResult
("xyz", dateTimeOffset), writer);
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),
Internal\Protocol\NewtonsoftJsonHubProtocolTests.cs (1)
103
new JsonProtocolTestData("CompletionMessage_HasFloatResult", CompletionMessage.
WithResult
("123", 2.0f), true, true, "{\"type\":3,\"invocationId\":\"123\",\"result\":2.0}"),
Microsoft.AspNetCore.SignalR.Core (1)
Internal\DefaultHubDispatcher.cs (1)
445
await connection.WriteAsync(CompletionMessage.
WithResult
(hubMethodInvocationMessage.InvocationId, result));
Microsoft.AspNetCore.SignalR.Specification.Tests (8)
HubLifetimeManagerTestBase.cs (4)
194
await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.
WithResult
(invocation.InvocationId, 10)).DefaultTimeout();
257
await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.
WithResult
(invocation.InvocationId, 10)).DefaultTimeout();
312
await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.
WithResult
(invocation1.InvocationId, 3));
365
await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.
WithResult
(invocation1.InvocationId, 1));
ScaleoutHubLifetimeManagerTests.cs (4)
491
await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.
WithResult
(invocation.InvocationId, 10)).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();
Microsoft.AspNetCore.SignalR.Tests (15)
HubConnectionHandlerTests.ClientResult.cs (12)
31
await client.SendHubMessageAsync(CompletionMessage.
WithResult
(invocationMessage.InvocationId, res)).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();
261
await client.SendHubMessageAsync(CompletionMessage.
WithResult
(invocationMessage.InvocationId, res)).DefaultTimeout();
267
await client.SendHubMessageAsync(CompletionMessage.
WithResult
(invocationMessage2.InvocationId, res)).DefaultTimeout();
273
await client.SendHubMessageAsync(CompletionMessage.
WithResult
(invocationMessage3.InvocationId, res)).DefaultTimeout();
310
await client.SendHubMessageAsync(CompletionMessage.
WithResult
(invocationMessage.InvocationId, res)).DefaultTimeout();
388
await client.SendHubMessageAsync(CompletionMessage.
WithResult
(invocation.InvocationId, 2)).DefaultTimeout();
433
await client.SendHubMessageAsync(CompletionMessage.
WithResult
(invocation.InvocationId, 2)).DefaultTimeout();
468
await client.SendHubMessageAsync(CompletionMessage.
WithResult
(invocationMessage.InvocationId, res)).DefaultTimeout();
503
await client.SendHubMessageAsync(CompletionMessage.
WithResult
(invocationMessage.InvocationId, res)).DefaultTimeout();
Internal\MessageBufferTests.cs (3)
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);