Skip to content

Commit 4e1e099

Browse files
authored
code cleanup for E2E tests (#1710)
1 parent 9f00f97 commit 4e1e099

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

test/Microsoft.Azure.SignalR.E2ETests/SignalR/TestClientSet.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace Microsoft.Azure.SignalR.Tests
1414
internal class TestClientSet : ITestClientSet
1515
{
1616
private readonly IList<HubConnection> _connections;
17+
1718
private ITestOutputHelper _output;
1819

1920
public int Count => _connections?.Count ?? 0;

test/Microsoft.Azure.SignalR.E2ETests/SignalR/TestServer.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,22 @@ namespace Microsoft.Azure.SignalR.Tests
1515
internal class TestServer : TestServerBase
1616
{
1717
private IWebHost _host;
18+
1819
private IServiceConnectionManager<TestHub> _scm;
1920

2021
public override TestHubConnectionManager HubConnectionManager { get; }
2122

22-
public TestServer(ITestOutputHelper output): base(output)
23+
public TestServer(ITestOutputHelper output) : base(output)
2324
{
2425
HubConnectionManager = new TestHubConnectionManager();
2526
}
2627

28+
public override async Task StopAsync()
29+
{
30+
await _host.StopAsync();
31+
await _scm.StopAsync();
32+
}
33+
2734
protected override Task StartCoreAsync(string serverUrl, ITestOutputHelper output, Dictionary<string, string> configuration)
2835
{
2936
_host = new WebHostBuilder()
@@ -32,7 +39,7 @@ protected override Task StartCoreAsync(string serverUrl, ITestOutputHelper outpu
3239
services.AddSingleton<TestHubConnectionManager>(HubConnectionManager);
3340
})
3441
.ConfigureLogging(logging => logging.AddXunit(output))
35-
.ConfigureAppConfiguration(builder => builder.AddInMemoryCollection(configuration))
42+
.ConfigureAppConfiguration(builder => builder.AddInMemoryCollection(configuration))
3643
.UseStartup<TestStartup>()
3744
.UseUrls(serverUrl)
3845
.UseKestrel()
@@ -42,11 +49,5 @@ protected override Task StartCoreAsync(string serverUrl, ITestOutputHelper outpu
4249

4350
return _host.StartAsync();
4451
}
45-
46-
public override async Task StopAsync()
47-
{
48-
await _host.StopAsync();
49-
await _scm.StopAsync();
50-
}
5152
}
5253
}

test/Microsoft.Azure.SignalR.E2ETests/SignalR/TestStartup.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ public TestStartup(IConfiguration configuration)
2525
public void Configure(IApplicationBuilder app)
2626
{
2727
app.UseRouting();
28-
app.UseEndpoints(configure =>
29-
{
30-
configure.MapHub<TestHub>($"/{nameof(TestHub)}");
31-
});
28+
app.UseEndpoints(configure => configure.MapHub<TestHub>($"/{nameof(TestHub)}"));
3229
app.UseMvc();
3330
}
3431

0 commit comments

Comments
 (0)