Skip to content

Commit a9a9298

Browse files
authored
Make SSEMessageFormatter internal and use new InternalsVisibleTo pattern (#11356)
1 parent 0648edf commit a9a9298

16 files changed

+43
-54
lines changed

src/SignalR/Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
<SignalRTestUtilsProject>$(MSBuildThisFileDirectory)common\testassets\Tests.Utils\Microsoft.AspNetCore.SignalR.Tests.Utils.csproj</SignalRTestUtilsProject>
77
</PropertyGroup>
88

9+
<!-- Keys used by InternalsVisibleTo attributes. -->
10+
<PropertyGroup>
11+
<MoqPublicKey>0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7</MoqPublicKey>
12+
</PropertyGroup>
13+
914
<PropertyGroup Condition="'$(IsTestProject)' != 'true'">
1015
<NoWarn>$(NoWarn);CS1591</NoWarn>
1116
<GenerateDocumentationFile>true</GenerateDocumentationFile>

src/SignalR/clients/csharp/Client.Core/src/Microsoft.AspNetCore.SignalR.Client.Core.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>Client for ASP.NET Core SignalR</Description>
@@ -37,4 +37,9 @@
3737
<SuppressBaselineReference Include="Microsoft.AspNetCore.SignalR.Protocols.Json" />
3838
</ItemGroup>
3939

40+
<ItemGroup>
41+
<InternalsVisibleTo Include="Microsoft.AspNetCore.SignalR.Client.FunctionalTests" />
42+
<InternalsVisibleTo Include="Microsoft.AspNetCore.SignalR.Client.Tests" />
43+
</ItemGroup>
44+
4045
</Project>

src/SignalR/clients/csharp/Client.Core/src/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/SignalR/clients/csharp/Http.Connections.Client/src/Microsoft.AspNetCore.Http.Connections.Client.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>Client for ASP.NET Core Connection Handlers</Description>
@@ -19,4 +19,11 @@
1919
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
2020
</ItemGroup>
2121

22+
<ItemGroup>
23+
<InternalsVisibleTo Include="Microsoft.AspNetCore.SignalR.Microbenchmarks" />
24+
<InternalsVisibleTo Include="Microsoft.AspNetCore.SignalR.Tests" />
25+
<InternalsVisibleTo Include="Microsoft.AspNetCore.SignalR.Client.Tests" />
26+
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="$(MoqPublicKey)" />
27+
</ItemGroup>
28+
2229
</Project>

src/SignalR/clients/csharp/Http.Connections.Client/src/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/SignalR/common/Http.Connections/ref/Microsoft.AspNetCore.Http.Connections.netcoreapp3.0.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ public partial class NegotiateMetadata
6161
{
6262
public NegotiateMetadata() { }
6363
}
64-
public static partial class ServerSentEventsMessageFormatter
65-
{
66-
[System.Diagnostics.DebuggerStepThroughAttribute]
67-
public static System.Threading.Tasks.Task WriteMessageAsync(System.Buffers.ReadOnlySequence<byte> payload, System.IO.Stream output) { throw null; }
68-
}
6964
public partial class WebSocketOptions
7065
{
7166
public WebSocketOptions() { }

src/SignalR/common/Http.Connections/src/Microsoft.AspNetCore.Http.Connections.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>Components for providing real-time bi-directional communication across the Web.</Description>
@@ -34,4 +34,8 @@
3434
<Reference Include="System.Security.Principal.Windows" />
3535
</ItemGroup>
3636

37+
<ItemGroup>
38+
<InternalsVisibleTo Include="Microsoft.AspNetCore.Http.Connections.Tests" />
39+
</ItemGroup>
40+
3741
</Project>

src/SignalR/common/Http.Connections/src/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/SignalR/common/Http.Connections/src/ServerSentEventsMessageFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Microsoft.AspNetCore.Http.Connections
1010
{
11-
public static class ServerSentEventsMessageFormatter
11+
internal static class ServerSentEventsMessageFormatter
1212
{
1313
private static readonly byte[] DataPrefix = { (byte)'d', (byte)'a', (byte)'t', (byte)'a', (byte)':', (byte)' ' };
1414
private static readonly byte[] Newline = { (byte)'\r', (byte)'\n' };

src/SignalR/common/SignalR.Common/src/Microsoft.AspNetCore.SignalR.Common.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,9 @@
3636
<SuppressBaselineReference Include="System.Buffers" />
3737
</ItemGroup>
3838

39+
<ItemGroup>
40+
<InternalsVisibleTo Include="Microsoft.AspNetCore.SignalR.Common.Tests" />
41+
<InternalsVisibleTo Include="Microsoft.AspNetCore.SignalR.Tests.Utils" />
42+
</ItemGroup>
43+
3944
</Project>

0 commit comments

Comments
 (0)