-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
264 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
199 changes: 117 additions & 82 deletions
199
test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Protocol/JsonHubProtocolTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
96 changes: 52 additions & 44 deletions
96
...icrosoft.AspNetCore.SignalR.Common.Tests/Internal/Protocol/MessagePackHubProtocolTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
test/Microsoft.AspNetCore.SignalR.Tests.Utils/HubProtocolHelpers.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Microsoft.AspNetCore.SignalR.Internal.Protocol; | ||
|
||
namespace Microsoft.AspNetCore.SignalR.Tests | ||
{ | ||
public static class HubProtocolHelpers | ||
{ | ||
private static readonly IHubProtocol JsonHubProtocol = new JsonHubProtocol(); | ||
|
||
private static readonly IHubProtocol MessagePackHubProtocol = new MessagePackHubProtocol(); | ||
|
||
public static readonly List<string> AllProtocolNames = new List<string> | ||
{ | ||
JsonHubProtocol.Name, | ||
MessagePackHubProtocol.Name | ||
}; | ||
|
||
public static readonly IList<IHubProtocol> AllProtocols = new List<IHubProtocol>() | ||
{ | ||
JsonHubProtocol, | ||
MessagePackHubProtocol | ||
}; | ||
|
||
public static IHubProtocol GetHubProtocol(string name) | ||
{ | ||
var protocol = AllProtocols.SingleOrDefault(p => p.Name == name); | ||
if (protocol == null) | ||
{ | ||
throw new InvalidOperationException($"Could not find protocol with name '{name}'."); | ||
} | ||
|
||
return protocol; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters