-
Notifications
You must be signed in to change notification settings - Fork 103
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
1 parent
8984d22
commit 827676f
Showing
7 changed files
with
74 additions
and
30 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
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
30 changes: 30 additions & 0 deletions
30
test/Microsoft.Azure.SignalR.AspNet.Tests/ConnectionFactoryTests.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,30 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using Microsoft.Extensions.Logging.Abstractions; | ||
|
||
using Xunit; | ||
|
||
namespace Microsoft.Azure.SignalR.AspNet.Tests; | ||
|
||
#nullable enable | ||
|
||
public class ConnectionFactoryTests | ||
{ | ||
[Fact] | ||
public void TestGetRequestHeaders() | ||
{ | ||
var nameProvider = new DefaultServerNameProvider(); | ||
|
||
var loggerFactory = NullLoggerFactory.Instance; | ||
|
||
var factory = new ConnectionFactory(nameProvider, loggerFactory); | ||
|
||
var headers = factory.GetRequestHeaders(); | ||
Assert.True(headers.TryGetValue(Constants.AsrsUserAgent, out var productInfo)); | ||
Assert.StartsWith("Microsoft.Azure.SignalR.AspNet/", productInfo); | ||
|
||
Assert.True(headers.TryGetValue(Constants.Headers.AsrsServerId, out var serverId)); | ||
Assert.Equal(nameProvider.GetName(), serverId); | ||
} | ||
} |
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