15 references to AddHeaders
Microsoft.AspNetCore.SignalR.Common.Tests (15)
Internal\Protocol\JsonHubProtocolTests.cs (1)
213
new JsonProtocolTestData("InvocationMessage_HasHeaders",
AddHeaders
(TestHeaders, new InvocationMessage("123", "Target", new object[] { 1, "Foo", 2.0f })), true, true, "{\"type\":1," + SerializedHeaders + ",\"invocationId\":\"123\",\"target\":\"Target\",\"arguments\":[1,\"Foo\",2]}"),
Internal\Protocol\JsonHubProtocolTestsBase.cs (6)
46
new JsonProtocolTestData("StreamItemMessage_HasHeaders",
AddHeaders
(TestHeaders, new StreamItemMessage("123", new CustomObject())), true, false, "{\"type\":2," + SerializedHeaders + ",\"invocationId\":\"123\",\"item\":{\"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\"}}"),
62
new JsonProtocolTestData("CompletionMessage_HasErrorAndHeadersAndCamelCase",
AddHeaders
(TestHeaders, CompletionMessage.Empty("123")), true, true, "{\"type\":3," + SerializedHeaders + ",\"invocationId\":\"123\"}"),
68
new JsonProtocolTestData("CompletionMessage_HasErrorAndHeaders",
AddHeaders
(TestHeaders, CompletionMessage.WithError("123", "Whoops!")), true, true, "{\"type\":3," + SerializedHeaders + ",\"invocationId\":\"123\",\"error\":\"Whoops!\"}"),
70
new JsonProtocolTestData("StreamInvocationMessage_HasHeaders",
AddHeaders
(TestHeaders, new StreamInvocationMessage("123", "Target", new object[] { new CustomObject() })), true, false, "{\"type\":4," + SerializedHeaders + ",\"invocationId\":\"123\",\"target\":\"Target\",\"arguments\":[{\"stringProp\":\"SignalR!\",\"doubleProp\":6.2831853071,\"intProp\":42,\"dateTimeProp\":\"2017-04-11T00:00:00Z\",\"nullProp\":null,\"byteArrProp\":\"AQID\"}]}"),
81
new JsonProtocolTestData("CancelInvocationMessage_HasHeaders",
AddHeaders
(TestHeaders, new CancelInvocationMessage("123")), true, true, "{\"type\":5," + SerializedHeaders + ",\"invocationId\":\"123\"}"),
Internal\Protocol\MessagePackHubProtocolTestBase.cs (3)
117
message:
AddHeaders
(TestHeaders, CompletionMessage.WithError("xyz", error: "Error not found!")),
125
message:
AddHeaders
(TestHeaders, CompletionMessage.Empty("xyz")),
173
message:
AddHeaders
(TestHeaders, new CancelInvocationMessage("xyz")),
Internal\Protocol\MessagePackHubProtocolTests.cs (4)
109
message:
AddHeaders
(TestHeaders, CompletionMessage.WithResult("xyz", payload: new[] { new CustomObject(), new CustomObject() })),
135
message:
AddHeaders
(TestHeaders, new InvocationMessage("method", new object[] { new CustomObject(), new CustomObject() })),
157
message:
AddHeaders
(TestHeaders, new StreamItemMessage("xyz", item: new[] { new CustomObject(), new CustomObject() })),
179
message:
AddHeaders
(TestHeaders, new StreamInvocationMessage("xyz", "method", new object[] { new CustomObject(), new CustomObject() })),
Internal\Protocol\NewtonsoftJsonHubProtocolTests.cs (1)
99
new JsonProtocolTestData("InvocationMessage_HasHeaders",
AddHeaders
(TestHeaders, new InvocationMessage("123", "Target", new object[] { 1, "Foo", 2.0f })), true, true, "{\"type\":1," + SerializedHeaders + ",\"invocationId\":\"123\",\"target\":\"Target\",\"arguments\":[1,\"Foo\",2.0]}"),