Skip to content

Commit 79d9315

Browse files
committed
Remove test as it is impossible to unit test reliably
1 parent 0794e88 commit 79d9315

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

src/Servers/Kestrel/Kestrel/test/KestrelConfigurationBuilderTests.cs

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.IO;
77
using System.Linq;
88
using System.Security.Cryptography.X509Certificates;
9-
using System.Threading.Tasks;
109
using Microsoft.AspNetCore.Hosting;
1110
using Microsoft.AspNetCore.Server.Kestrel.Core;
1211
using Microsoft.AspNetCore.Server.Kestrel.Https;
@@ -15,8 +14,6 @@
1514
using Microsoft.Extensions.DependencyInjection;
1615
using Microsoft.Extensions.FileProviders;
1716
using Microsoft.Extensions.Hosting;
18-
using Microsoft.Extensions.Logging;
19-
using Microsoft.Extensions.Logging.Testing;
2017
using Xunit;
2118

2219
namespace Microsoft.AspNetCore.Server.Kestrel.Tests
@@ -25,41 +22,15 @@ public class KestrelConfigurationBuilderTests
2522
{
2623
private KestrelServerOptions CreateServerOptions()
2724
{
28-
var testSink = new TestSink();
2925
var serverOptions = new KestrelServerOptions();
3026
var env = new MockHostingEnvironment { ApplicationName = "TestApplication" };
3127
serverOptions.ApplicationServices = new ServiceCollection()
32-
.AddLogging(l => l.AddProvider(new TestLoggerProvider(testSink)))
28+
.AddLogging()
3329
.AddSingleton<IHostEnvironment>(env)
34-
.AddSingleton(testSink)
3530
.BuildServiceProvider();
3631
return serverOptions;
3732
}
3833

39-
[Fact]
40-
[SkipOnHelix("(none)", Queues = "Ubuntu.1604.Amd64.Open;Windows.10.Amd64.Open")]
41-
[OSSkipCondition(OperatingSystems.Linux, SkipReason = "This check only applies to Mac OS as it is the one that checks the key for validity.")]
42-
[OSSkipCondition(OperatingSystems.Windows, SkipReason = "This check only applies to Mac OS as it is the one that checks the key for validity.")]
43-
public void DevCertWithInvalidPrivateKeyProducesCustomWarning()
44-
{
45-
var serverOptions = CreateServerOptions();
46-
var sink = serverOptions.ApplicationServices.GetRequiredService<TestSink>();
47-
var messages = new List<WriteContext>();
48-
sink.MessageLogged += wc => messages.Add(wc);
49-
serverOptions.Configure()
50-
.LocalhostEndpoint(5001, endpointOptions => { });
51-
52-
Assert.Empty(serverOptions.ListenOptions);
53-
54-
serverOptions.ConfigurationLoader.Load();
55-
56-
Assert.Single(serverOptions.ListenOptions);
57-
Assert.Equal(5001, serverOptions.ListenOptions[0].IPEndPoint.Port);
58-
59-
Assert.Equal(5, messages[^1].EventId);
60-
Assert.Equal(LogLevel.Warning, messages[^1].LogLevel);
61-
}
62-
6334
[Fact]
6435
public void ConfigureNamedEndpoint_OnlyRunForMatchingConfig()
6536
{

0 commit comments

Comments
 (0)