Skip to content

Commit de21923

Browse files
Add API docs for AzureAppServices and SignalR.Specification (#28963)
1 parent f5cd6f7 commit de21923

File tree

7 files changed

+126
-20
lines changed

7 files changed

+126
-20
lines changed

src/Azure/AzureAppServicesIntegration/src/AppServicesWebHostBuilderExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace Microsoft.AspNetCore.Hosting
88
{
9+
/// <summary>
10+
/// Extension method to add Azure AppServices integration to the app.
11+
/// </summary>
912
public static class AppServicesWebHostBuilderExtensions
1013
{
1114
/// <summary>

src/Azure/AzureAppServicesIntegration/src/Microsoft.AspNetCore.AzureAppServicesIntegration.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>ASP.NET Core integration with Azure AppServices.</Description>
55
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
6-
<NoWarn>$(NoWarn);CS1591</NoWarn>
76
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
87
<GenerateDocumentationFile>true</GenerateDocumentationFile>
98
<PackageTags>aspnetcore;azure;appservices</PackageTags>

src/SignalR/server/SignalR/test/DefaultHubLifetimeManagerTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
namespace Microsoft.AspNetCore.SignalR.Tests
1414
{
15-
public class DefaultHubLifetimeManagerTests : HubLifetimeManagerTestsBase<MyHub>
15+
public class DefaultHubLifetimeManagerTests : HubLifetimeManagerTestsBase<Hub>
1616
{
17-
public override HubLifetimeManager<MyHub> CreateNewHubLifetimeManager()
17+
public override HubLifetimeManager<Hub> CreateNewHubLifetimeManager()
1818
{
19-
return new DefaultHubLifetimeManager<MyHub>(new Logger<DefaultHubLifetimeManager<MyHub>>(NullLoggerFactory.Instance));
19+
return new DefaultHubLifetimeManager<Hub>(new Logger<DefaultHubLifetimeManager<Hub>>(NullLoggerFactory.Instance));
2020
}
2121

2222
[Fact]

src/SignalR/server/Specification.Tests/src/HubLifetimeManagerTestBase.cs

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,36 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4+
using System;
45
using System.Threading.Tasks;
56
using Microsoft.AspNetCore.SignalR.Protocol;
67
using Microsoft.AspNetCore.SignalR.Tests;
78
using Xunit;
89

910
namespace Microsoft.AspNetCore.SignalR.Specification.Tests
1011
{
12+
/// <summary>
13+
/// Base test class for lifetime manager implementations. Nothing specific to scale-out for these tests.
14+
/// </summary>
15+
/// <typeparam name="THub">The type of the <see cref="Hub"/>.</typeparam>
1116
public abstract class HubLifetimeManagerTestsBase<THub> where THub : Hub
1217
{
18+
/// <summary>
19+
/// This API is obsolete and will be removed in a future version. Use CreateNewHubLifetimeManager in tests instead.
20+
/// </summary>
21+
[Obsolete("This API is obsolete and will be removed in a future version. Use CreateNewHubLifetimeManager in tests instead.")]
1322
public HubLifetimeManager<THub> Manager { get; set; }
1423

24+
/// <summary>
25+
/// Method to create an implementation of <see cref="HubLifetimeManager{THub}"/> for use in tests.
26+
/// </summary>
27+
/// <returns>The implementation of <see cref="HubLifetimeManager{THub}"/> to test against.</returns>
1528
public abstract HubLifetimeManager<THub> CreateNewHubLifetimeManager();
1629

30+
/// <summary>
31+
/// Specification test for SignalR HubLifetimeManager.
32+
/// </summary>
33+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
1734
[Fact]
1835
public async Task SendAllAsyncWritesToAllConnectionsOutput()
1936
{
@@ -41,6 +58,10 @@ public async Task SendAllAsyncWritesToAllConnectionsOutput()
4158
}
4259
}
4360

61+
/// <summary>
62+
/// Specification test for SignalR HubLifetimeManager.
63+
/// </summary>
64+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
4465
[Fact]
4566
public async Task SendAllAsyncDoesNotWriteToDisconnectedConnectionsOutput()
4667
{
@@ -67,6 +88,10 @@ public async Task SendAllAsyncDoesNotWriteToDisconnectedConnectionsOutput()
6788
}
6889
}
6990

91+
/// <summary>
92+
/// Specification test for SignalR HubLifetimeManager.
93+
/// </summary>
94+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
7095
[Fact]
7196
public async Task SendGroupAsyncWritesToAllConnectionsInGroupOutput()
7297
{
@@ -93,6 +118,10 @@ public async Task SendGroupAsyncWritesToAllConnectionsInGroupOutput()
93118
}
94119
}
95120

121+
/// <summary>
122+
/// Specification test for SignalR HubLifetimeManager.
123+
/// </summary>
124+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
96125
[Fact]
97126
public async Task SendGroupExceptAsyncDoesNotWriteToExcludedConnections()
98127
{
@@ -120,6 +149,10 @@ public async Task SendGroupExceptAsyncDoesNotWriteToExcludedConnections()
120149
}
121150
}
122151

152+
/// <summary>
153+
/// Specification test for SignalR HubLifetimeManager.
154+
/// </summary>
155+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
123156
[Fact]
124157
public async Task SendConnectionAsyncWritesToConnectionOutput()
125158
{

src/SignalR/server/Specification.Tests/src/Microsoft.AspNetCore.SignalR.Specification.Tests.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>Tests for users to verify their own implementations of SignalR types</Description>
55
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
66
<IsPackable>true</IsPackable>
7-
<NoWarn>$(NoWarn);CS1591</NoWarn>
87
</PropertyGroup>
98

109
<ItemGroup>

src/SignalR/server/Specification.Tests/src/ScaleoutHubLifetimeManagerTests.cs

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
using System;
5-
using System.Threading;
64
using System.Threading.Tasks;
75
using Microsoft.AspNetCore.SignalR.Protocol;
86
using Microsoft.AspNetCore.SignalR.Tests;
97
using Xunit;
108

119
namespace Microsoft.AspNetCore.SignalR.Specification.Tests
1210
{
13-
public abstract class ScaleoutHubLifetimeManagerTests<TBackplane> : HubLifetimeManagerTestsBase<MyHub>
11+
/// <summary>
12+
/// Base test class for lifetime manager implementations that support server scale-out.
13+
/// </summary>
14+
/// <typeparam name="TBackplane">An in-memory implementation of the backplane that <see cref="HubLifetimeManager{THub}"/>s communicate with.</typeparam>
15+
public abstract class ScaleoutHubLifetimeManagerTests<TBackplane> : HubLifetimeManagerTestsBase<Hub>
1416
{
17+
/// <summary>
18+
/// Method to create an implementation of an in-memory backplane for use in tests.
19+
/// </summary>
20+
/// <returns>The backplane implementation.</returns>
1521
public abstract TBackplane CreateBackplane();
16-
public abstract HubLifetimeManager<MyHub> CreateNewHubLifetimeManager(TBackplane backplane);
22+
23+
/// <summary>
24+
/// Method to create an implementation of <see cref="HubLifetimeManager{THub}"/> that uses the backplane from <see cref="CreateBackplane"/>.
25+
/// </summary>
26+
/// <param name="backplane">The backplane implementation for use in the <see cref="HubLifetimeManager{THub}"/>.</param>
27+
/// <returns></returns>
28+
public abstract HubLifetimeManager<Hub> CreateNewHubLifetimeManager(TBackplane backplane);
1729

1830
private async Task AssertMessageAsync(TestClient client)
1931
{
@@ -23,9 +35,12 @@ private async Task AssertMessageAsync(TestClient client)
2335
Assert.Equal("World", (string)message.Arguments[0]);
2436
}
2537

38+
/// <summary>
39+
/// Specification test for SignalR HubLifetimeManager.
40+
/// </summary>
41+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
2642
[Fact]
2743
public async Task InvokeAllAsyncWithMultipleServersWritesToAllConnectionsOutput()
28-
2944
{
3045
var backplane = CreateBackplane();
3146
var manager1 = CreateNewHubLifetimeManager(backplane);
@@ -47,6 +62,10 @@ public async Task InvokeAllAsyncWithMultipleServersWritesToAllConnectionsOutput(
4762
}
4863
}
4964

65+
/// <summary>
66+
/// Specification test for SignalR HubLifetimeManager.
67+
/// </summary>
68+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
5069
[Fact]
5170
public async Task InvokeAllAsyncWithMultipleServersDoesNotWriteToDisconnectedConnectionsOutput()
5271
{
@@ -73,6 +92,10 @@ public async Task InvokeAllAsyncWithMultipleServersDoesNotWriteToDisconnectedCon
7392
}
7493
}
7594

95+
/// <summary>
96+
/// Specification test for SignalR HubLifetimeManager.
97+
/// </summary>
98+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
7699
[Fact]
77100
public async Task InvokeConnectionAsyncOnServerWithoutConnectionWritesOutputToConnection()
78101
{
@@ -93,6 +116,10 @@ public async Task InvokeConnectionAsyncOnServerWithoutConnectionWritesOutputToCo
93116
}
94117
}
95118

119+
/// <summary>
120+
/// Specification test for SignalR HubLifetimeManager.
121+
/// </summary>
122+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
96123
[Fact]
97124
public async Task InvokeGroupAsyncOnServerWithoutConnectionWritesOutputToGroupConnection()
98125
{
@@ -115,6 +142,10 @@ public async Task InvokeGroupAsyncOnServerWithoutConnectionWritesOutputToGroupCo
115142
}
116143
}
117144

145+
/// <summary>
146+
/// Specification test for SignalR HubLifetimeManager.
147+
/// </summary>
148+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
118149
[Fact]
119150
public async Task DisconnectConnectionRemovesConnectionFromGroup()
120151
{
@@ -137,6 +168,10 @@ public async Task DisconnectConnectionRemovesConnectionFromGroup()
137168
}
138169
}
139170

171+
/// <summary>
172+
/// Specification test for SignalR HubLifetimeManager.
173+
/// </summary>
174+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
140175
[Fact]
141176
public async Task RemoveGroupFromLocalConnectionNotInGroupDoesNothing()
142177
{
@@ -153,6 +188,10 @@ public async Task RemoveGroupFromLocalConnectionNotInGroupDoesNothing()
153188
}
154189
}
155190

191+
/// <summary>
192+
/// Specification test for SignalR HubLifetimeManager.
193+
/// </summary>
194+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
156195
[Fact]
157196
public async Task RemoveGroupFromConnectionOnDifferentServerNotInGroupDoesNothing()
158197
{
@@ -170,6 +209,10 @@ public async Task RemoveGroupFromConnectionOnDifferentServerNotInGroupDoesNothin
170209
}
171210
}
172211

212+
/// <summary>
213+
/// Specification test for SignalR HubLifetimeManager.
214+
/// </summary>
215+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
173216
[Fact]
174217
public async Task AddGroupAsyncForConnectionOnDifferentServerWorks()
175218
{
@@ -191,6 +234,10 @@ public async Task AddGroupAsyncForConnectionOnDifferentServerWorks()
191234
}
192235
}
193236

237+
/// <summary>
238+
/// Specification test for SignalR HubLifetimeManager.
239+
/// </summary>
240+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
194241
[Fact]
195242
public async Task AddGroupAsyncForLocalConnectionAlreadyInGroupDoesNothing()
196243
{
@@ -213,6 +260,10 @@ public async Task AddGroupAsyncForLocalConnectionAlreadyInGroupDoesNothing()
213260
}
214261
}
215262

263+
/// <summary>
264+
/// Specification test for SignalR HubLifetimeManager.
265+
/// </summary>
266+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
216267
[Fact]
217268
public async Task AddGroupAsyncForConnectionOnDifferentServerAlreadyInGroupDoesNothing()
218269
{
@@ -236,6 +287,10 @@ public async Task AddGroupAsyncForConnectionOnDifferentServerAlreadyInGroupDoesN
236287
}
237288
}
238289

290+
/// <summary>
291+
/// Specification test for SignalR HubLifetimeManager.
292+
/// </summary>
293+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
239294
[Fact]
240295
public async Task RemoveGroupAsyncForConnectionOnDifferentServerWorks()
241296
{
@@ -263,6 +318,10 @@ public async Task RemoveGroupAsyncForConnectionOnDifferentServerWorks()
263318
}
264319
}
265320

321+
/// <summary>
322+
/// Specification test for SignalR HubLifetimeManager.
323+
/// </summary>
324+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
266325
[Fact]
267326
public async Task InvokeConnectionAsyncForLocalConnectionDoesNotPublishToBackplane()
268327
{
@@ -285,6 +344,10 @@ public async Task InvokeConnectionAsyncForLocalConnectionDoesNotPublishToBackpla
285344
}
286345
}
287346

347+
/// <summary>
348+
/// Specification test for SignalR HubLifetimeManager.
349+
/// </summary>
350+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
288351
[Fact]
289352
public async Task WritingToRemoteConnectionThatFailsDoesNotThrow()
290353
{
@@ -305,6 +368,10 @@ public async Task WritingToRemoteConnectionThatFailsDoesNotThrow()
305368
}
306369
}
307370

371+
/// <summary>
372+
/// Specification test for SignalR HubLifetimeManager.
373+
/// </summary>
374+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
308375
[Fact]
309376
public async Task WritingToGroupWithOneConnectionFailingSecondConnectionStillReceivesMessage()
310377
{
@@ -336,6 +403,10 @@ public async Task WritingToGroupWithOneConnectionFailingSecondConnectionStillRec
336403
}
337404
}
338405

406+
/// <summary>
407+
/// Specification test for SignalR HubLifetimeManager.
408+
/// </summary>
409+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
339410
[Fact]
340411
public async Task InvokeUserSendsToAllConnectionsForUser()
341412
{
@@ -360,6 +431,10 @@ public async Task InvokeUserSendsToAllConnectionsForUser()
360431
}
361432
}
362433

434+
/// <summary>
435+
/// Specification test for SignalR HubLifetimeManager.
436+
/// </summary>
437+
/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns>
363438
[Fact]
364439
public async Task StillSubscribedToUserAfterOneOfMultipleConnectionsAssociatedWithUserDisconnects()
365440
{
@@ -389,7 +464,4 @@ public async Task StillSubscribedToUserAfterOneOfMultipleConnectionsAssociatedWi
389464
}
390465
}
391466
}
392-
public class MyHub : Hub
393-
{
394-
}
395467
}

src/SignalR/server/StackExchangeRedis/test/RedisHubLifetimeManagerTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ public class TestObject
2222
public string TestProperty { get; set; }
2323
}
2424

25-
private RedisHubLifetimeManager<MyHub> CreateLifetimeManager(TestRedisServer server, MessagePackHubProtocolOptions messagePackOptions = null, NewtonsoftJsonHubProtocolOptions jsonOptions = null)
25+
private RedisHubLifetimeManager<Hub> CreateLifetimeManager(TestRedisServer server, MessagePackHubProtocolOptions messagePackOptions = null, NewtonsoftJsonHubProtocolOptions jsonOptions = null)
2626
{
2727
var options = new RedisOptions() { ConnectionFactory = async (t) => await Task.FromResult(new TestConnectionMultiplexer(server)) };
2828
messagePackOptions = messagePackOptions ?? new MessagePackHubProtocolOptions();
2929
jsonOptions = jsonOptions ?? new NewtonsoftJsonHubProtocolOptions();
30-
return new RedisHubLifetimeManager<MyHub>(
31-
NullLogger<RedisHubLifetimeManager<MyHub>>.Instance,
30+
return new RedisHubLifetimeManager<Hub>(
31+
NullLogger<RedisHubLifetimeManager<Hub>>.Instance,
3232
Options.Create(options),
3333
new DefaultHubProtocolResolver(new IHubProtocol[]
3434
{

0 commit comments

Comments
 (0)