JsonHubProtocol and MessagePackHubProtocol version fields now private (#2023)

This commit is contained in:
James Newton-King 2018-04-15 09:58:05 +12:00 committed by GitHub
parent 5a77c8be25
commit 377ed1b834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -28,8 +28,8 @@ namespace Microsoft.AspNetCore.SignalR.Protocol
private const string ArgumentsPropertyName = "arguments"; private const string ArgumentsPropertyName = "arguments";
private const string HeadersPropertyName = "headers"; private const string HeadersPropertyName = "headers";
public static readonly string ProtocolName = "json"; private static readonly string ProtocolName = "json";
public static readonly int ProtocolVersion = 1; private static readonly int ProtocolVersion = 1;
// ONLY to be used for application payloads (args, return values, etc.) // ONLY to be used for application payloads (args, return values, etc.)
public JsonSerializer PayloadSerializer { get; } public JsonSerializer PayloadSerializer { get; }

View File

@ -25,8 +25,8 @@ namespace Microsoft.AspNetCore.SignalR.Protocol
private IFormatterResolver _resolver; private IFormatterResolver _resolver;
public static readonly string ProtocolName = "messagepack"; private static readonly string ProtocolName = "messagepack";
public static readonly int ProtocolVersion = 1; private static readonly int ProtocolVersion = 1;
public string Name => ProtocolName; public string Name => ProtocolName;

View File

@ -117,11 +117,11 @@ namespace Microsoft.AspNetCore.SignalR.Redis.Tests
{ {
foreach (var transport in TransportTypes()) foreach (var transport in TransportTypes())
{ {
yield return new object[] { transport, JsonHubProtocol.ProtocolName }; yield return new object[] { transport, "json" };
if (transport != HttpTransportType.ServerSentEvents) if (transport != HttpTransportType.ServerSentEvents)
{ {
yield return new object[] { transport, MessagePackHubProtocol.ProtocolName }; yield return new object[] { transport, "messagepack" };
} }
} }
} }

View File

@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.SignalR.Common.Protocol.Tests
new JsonHubProtocol() new JsonHubProtocol()
}, NullLogger<DefaultHubProtocolResolver>.Instance)); }, NullLogger<DefaultHubProtocolResolver>.Instance));
Assert.Equal($"Multiple Hub Protocols with the name '{JsonHubProtocol.ProtocolName}' were registered.", exception.Message); Assert.Equal($"Multiple Hub Protocols with the name 'json' were registered.", exception.Message);
} }
public static IEnumerable<object[]> HubProtocolNames => HubProtocolHelpers.AllProtocols.Select(p => new object[] {p.Name}); public static IEnumerable<object[]> HubProtocolNames => HubProtocolHelpers.AllProtocols.Select(p => new object[] {p.Name});