diff --git a/KestrelHttpServer.sln b/KestrelHttpServer.sln index 7615861212..1a5cda8a81 100644 --- a/KestrelHttpServer.sln +++ b/KestrelHttpServer.sln @@ -34,7 +34,15 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{0EF2ACDF-012F-4472-A13A-4272419E2903}" ProjectSection(SolutionItems) = preProject + test\shared\DummyApplication.cs = test\shared\DummyApplication.cs test\shared\HttpClientSlim.cs = test\shared\HttpClientSlim.cs + test\shared\LifetimeNotImplemented.cs = test\shared\LifetimeNotImplemented.cs + test\shared\MockSystemClock.cs = test\shared\MockSystemClock.cs + test\shared\TestApplicationErrorLogger.cs = test\shared\TestApplicationErrorLogger.cs + test\shared\TestConnection.cs = test\shared\TestConnection.cs + test\shared\TestKestrelTrace.cs = test\shared\TestKestrelTrace.cs + test\shared\TestServer.cs = test\shared\TestServer.cs + test\shared\TestServiceContext.cs = test\shared\TestServiceContext.cs EndProjectSection EndProject Global diff --git a/src/Microsoft.AspNetCore.Server.Kestrel/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Server.Kestrel/Properties/AssemblyInfo.cs index 603dc45398..8989a4b649 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel/Properties/AssemblyInfo.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Server.Kestrel.FunctionalTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Server.KestrelTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: NeutralResourcesLanguage("en-us")] diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/project.json b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/project.json index 07b88977b3..e90217c86f 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/project.json @@ -36,6 +36,7 @@ "../shared/**/*.cs" ] }, + "keyFile": "../../tools/Key.snk", "copyToOutput": { "include": "TestResources/testCert.pfx" } diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedRequestTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedRequestTests.cs index 476cddae2c..6ef64cf30e 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedRequestTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedRequestTests.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedResponseTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedResponseTests.cs index 8e9d12e4dd..d4936ba0c9 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedResponseTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedResponseTests.cs @@ -5,7 +5,7 @@ using System; using System.Text; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionFilterTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionFilterTests.cs index 965a427b97..d2a3b7cc22 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionFilterTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionFilterTests.cs @@ -6,6 +6,7 @@ using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Server.Kestrel.Filter; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs index cdcacc071c..d6fdadf968 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/DateHeaderValueManagerTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/DateHeaderValueManagerTests.cs index 0d3e4dc133..ddfce0d3a6 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/DateHeaderValueManagerTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/DateHeaderValueManagerTests.cs @@ -5,7 +5,7 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/DefaultHeaderTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/DefaultHeaderTests.cs index 964345b48a..127aa2b221 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/DefaultHeaderTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/DefaultHeaderTests.cs @@ -2,9 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameTests.cs index 5a0492ea19..ecd438a5c5 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameTests.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Internal; using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerTests.cs index ae4f63828d..c7edfe82f9 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerTests.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Reflection; using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Server.Kestrel; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Moq; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/LoggingThreadPoolTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/LoggingThreadPoolTests.cs index 431e79b119..65f37daf44 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/LoggingThreadPoolTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/LoggingThreadPoolTests.cs @@ -3,10 +3,9 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/RequestTargetProcessingTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/RequestTargetProcessingTests.cs index 5c1c25d373..e01610a93d 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/RequestTargetProcessingTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/RequestTargetProcessingTests.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/SocketInputTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/SocketInputTests.cs index ecef0c1538..b2bb528649 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/SocketInputTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/SocketInputTests.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Internal; using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; +using Microsoft.AspNetCore.Testing; using Moq; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/SocketOutputTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/SocketOutputTests.cs index 31ae21dbe6..bcd15a643c 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/SocketOutputTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/SocketOutputTests.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Internal; using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/StreamSocketOutputTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/StreamSocketOutputTests.cs index f01397fc0f..ab8f83e46e 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/StreamSocketOutputTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/StreamSocketOutputTests.cs @@ -3,9 +3,9 @@ using System; using System.IO; -using Microsoft.AspNetCore.Server.Kestrel.Filter; using Microsoft.AspNetCore.Server.Kestrel.Filter.Internal; using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/PassThroughConnectionFilter.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/PassThroughConnectionFilter.cs index 561609899a..b398021e7d 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/PassThroughConnectionFilter.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/PassThroughConnectionFilter.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Server.Kestrel.Filter; using Microsoft.AspNetCore.Server.Kestrel.Filter.Internal; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Testing; namespace Microsoft.AspNetCore.Server.KestrelTests { diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestInput.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/TestInput.cs index 955cb088b9..de0edf5020 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestInput.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/TestInput.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Internal; using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; +using Microsoft.AspNetCore.Testing; namespace Microsoft.AspNetCore.Server.KestrelTests { diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/DummyApplication.cs b/test/shared/DummyApplication.cs similarity index 95% rename from test/Microsoft.AspNetCore.Server.KestrelTests/DummyApplication.cs rename to test/shared/DummyApplication.cs index 842c1156dd..a4b3eb4b1a 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/DummyApplication.cs +++ b/test/shared/DummyApplication.cs @@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -namespace Microsoft.AspNetCore.Server.KestrelTests +namespace Microsoft.AspNetCore.Testing { public class DummyApplication : IHttpApplication { diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/LifetimeNotImplemented.cs b/test/shared/LifetimeNotImplemented.cs similarity index 94% rename from test/Microsoft.AspNetCore.Server.KestrelTests/LifetimeNotImplemented.cs rename to test/shared/LifetimeNotImplemented.cs index feba1c80fd..df5253cc62 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/LifetimeNotImplemented.cs +++ b/test/shared/LifetimeNotImplemented.cs @@ -5,7 +5,7 @@ using System; using System.Threading; using Microsoft.AspNetCore.Hosting; -namespace Microsoft.AspNetCore.Server.KestrelTests +namespace Microsoft.AspNetCore.Testing { public class LifetimeNotImplemented : IApplicationLifetime { diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockSystemClock.cs b/test/shared/MockSystemClock.cs similarity index 91% rename from test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockSystemClock.cs rename to test/shared/MockSystemClock.cs index d18e114f5c..5a903c1f2e 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockSystemClock.cs +++ b/test/shared/MockSystemClock.cs @@ -4,7 +4,7 @@ using System; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.KestrelTests.TestHelpers +namespace Microsoft.AspNetCore.Testing { public class MockSystemClock : ISystemClock { diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/TestApplicationErrorLogger.cs b/test/shared/TestApplicationErrorLogger.cs similarity index 94% rename from test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/TestApplicationErrorLogger.cs rename to test/shared/TestApplicationErrorLogger.cs index 419a617407..d2d3731a9d 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/TestApplicationErrorLogger.cs +++ b/test/shared/TestApplicationErrorLogger.cs @@ -2,11 +2,10 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel; using Microsoft.AspNetCore.Server.Kestrel.Internal; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.KestrelTests +namespace Microsoft.AspNetCore.Testing { public class TestApplicationErrorLogger : ILogger { diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/TestKestrelTrace.cs b/test/shared/TestKestrelTrace.cs similarity index 95% rename from test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/TestKestrelTrace.cs rename to test/shared/TestKestrelTrace.cs index 741ec54a0b..814005d4d1 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/TestKestrelTrace.cs +++ b/test/shared/TestKestrelTrace.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Internal; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.KestrelTests +namespace Microsoft.AspNetCore.Testing { public class TestKestrelTrace : KestrelTrace { diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestServer.cs b/test/shared/TestServer.cs similarity index 95% rename from test/Microsoft.AspNetCore.Server.KestrelTests/TestServer.cs rename to test/shared/TestServer.cs index e01d35fa70..738b0b10df 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestServer.cs +++ b/test/shared/TestServer.cs @@ -6,9 +6,8 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Server.Kestrel; using Microsoft.AspNetCore.Server.Kestrel.Internal; using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Testing; -namespace Microsoft.AspNetCore.Server.KestrelTests +namespace Microsoft.AspNetCore.Testing { /// /// Summary description for TestServer diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestServiceContext.cs b/test/shared/TestServiceContext.cs similarity index 93% rename from test/Microsoft.AspNetCore.Server.KestrelTests/TestServiceContext.cs rename to test/shared/TestServiceContext.cs index 10049f461c..9da3e8811b 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestServiceContext.cs +++ b/test/shared/TestServiceContext.cs @@ -8,9 +8,8 @@ using Microsoft.AspNetCore.Server.Kestrel.Filter; using Microsoft.AspNetCore.Server.Kestrel.Internal; using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; -namespace Microsoft.AspNetCore.Server.KestrelTests +namespace Microsoft.AspNetCore.Testing { public class TestServiceContext : ServiceContext {