From 6725d68559a55713fdd3d2e38de2ab22059219da Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Sun, 27 Mar 2016 00:51:12 -0700 Subject: [PATCH] Move some implementations (all feature implementations) out of `.Internal` namespaces - #549, #592 - move feature implementations to `Microsoft.AspNetCore.Http.Features` and `...Authentication.Features` - move `DefaultHttpContext`, `HttpContextAccessor`, `HttpContextFactory`, `FormCollection` and `HeaderDictionary` to `Microsoft.AspNetCore.Http` - move `FormFile` to `Microsoft.AspNetCore.Http.Internal` - that and `Microsoft.AspNetCore.Http.Authentication.Internal` are the remaining `.Internal` namespaces nits: - remove a couple of parameterless constructors - add / fill subfolders to align with new namespaces - remove all use of (unnecessary) "T:..." `` values --- samples/SampleApp/PooledHttpContext.cs | 2 +- samples/SampleApp/PooledHttpContextFactory.cs | 1 - .../Internal/HeaderSegment.cs | 3 +- .../IFormCollection.cs | 32 +++++++++--------- .../IQueryCollection.cs | 33 +++++++++---------- .../IRequestCookieCollection.cs | 32 +++++++++--------- .../DefaultAuthenticationManager.cs | 1 - .../DefaultHttpContext.cs | 9 +++-- .../HttpAuthenticationFeature.cs | 6 +--- .../Features/DefaultSessionFeature.cs | 2 +- .../Features/FormFeature.cs | 2 +- .../Features/HttpConnectionFeature.cs | 6 +--- .../Features/HttpRequestFeature.cs | 3 +- .../Features/HttpRequestIdentifierFeature.cs | 2 +- .../Features/HttpRequestLifetimeFeature.cs | 2 +- .../Features/HttpResponseFeature.cs | 3 +- .../Features/ItemsFeature.cs | 2 +- .../Features/QueryFeature.cs | 2 +- .../Features/RequestCookiesFeature.cs | 4 +-- .../Features/ResponseCookiesFeature.cs | 2 +- .../Features/ServiceProvidersFeature.cs | 2 +- .../Features/TlsConnectionFeature.cs | 6 +--- .../FormCollection.cs | 23 ++++++------- .../HeaderDictionary.cs | 30 ++++++++--------- .../HttpContextAccessor.cs | 5 ++- .../HttpContextFactory.cs | 3 +- .../{ => Internal}/ApplicationBuilder.cs | 0 .../{ => Internal}/BufferingHelper.cs | 0 .../{ => Internal}/Constants.cs | 0 .../{ => Internal}/DefaultConnectionInfo.cs | 1 - .../{ => Internal}/DefaultHttpRequest.cs | 1 - .../{ => Internal}/DefaultHttpResponse.cs | 3 +- .../{ => Internal}/DefaultWebSocketManager.cs | 0 .../{Features => Internal}/FormFile.cs | 3 +- .../{ => Internal}/FormFileCollection.cs | 0 .../{ => Internal}/ItemsDictionary.cs | 0 .../{ => Internal}/ParsingHelpers.cs | 2 +- .../{ => Internal}/QueryCollection.cs | 20 +++++------ .../{ => Internal}/ReferenceReadStream.cs | 0 .../{ => Internal}/RequestCookieCollection.cs | 14 ++++---- .../{ => Internal}/ResponseCookies.cs | 0 .../OwinEnvironment.cs | 2 -- .../OwinExtensions.cs | 1 - .../HttpResponseWritingExtensionsTests.cs | 1 - .../MapPathMiddlewareTests.cs | 1 - .../MapPredicateMiddlewareTests.cs | 2 -- .../UseMiddlewareTest.cs | 1 - .../HeaderDictionaryTypeExtensionsTest.cs | 1 - .../ResponseExtensionTests.cs | 3 -- .../SendFileResponseExtensionsTests.cs | 2 -- .../UriHelperTests.cs | 1 - .../DefaultAuthenticationManagerTests.cs | 3 -- .../DefaultHttpContextTests.cs | 3 +- .../{ => Features}/FakeResponseFeature.cs | 3 +- .../{ => Features}/FormFeatureTests.cs | 2 +- .../HttpRequestIdentifierFeatureTests.cs | 3 +- .../{ => Features}/NonSeekableReadStream.cs | 2 +- .../{ => Features}/QueryFeatureTests.cs | 2 +- .../HeaderDictionaryTests.cs | 2 +- .../HttpContextFactoryTests.cs | 2 +- .../{ => Internal}/ApplicationBuilderTests.cs | 2 +- .../{ => Internal}/BufferingHelperTests.cs | 0 .../{ => Internal}/DefaultHttpRequestTests.cs | 0 .../DefaultHttpResponseTests.cs | 0 .../OwinEnvironmentTests.cs | 1 - .../OwinExtensionTests.cs | 1 - 66 files changed, 128 insertions(+), 175 deletions(-) rename src/Microsoft.AspNetCore.Http/{ => Internal}/ApplicationBuilder.cs (100%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/BufferingHelper.cs (100%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/Constants.cs (100%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/DefaultConnectionInfo.cs (98%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/DefaultHttpRequest.cs (98%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/DefaultHttpResponse.cs (98%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/DefaultWebSocketManager.cs (100%) rename src/Microsoft.AspNetCore.Http/{Features => Internal}/FormFile.cs (97%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/FormFileCollection.cs (100%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/ItemsDictionary.cs (100%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/ParsingHelpers.cs (99%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/QueryCollection.cs (86%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/ReferenceReadStream.cs (100%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/RequestCookieCollection.cs (92%) rename src/Microsoft.AspNetCore.Http/{ => Internal}/ResponseCookies.cs (100%) rename test/Microsoft.AspNetCore.Http.Tests/{ => Features}/FakeResponseFeature.cs (89%) rename test/Microsoft.AspNetCore.Http.Tests/{ => Features}/FormFeatureTests.cs (99%) rename test/Microsoft.AspNetCore.Http.Tests/{ => Features}/HttpRequestIdentifierFeatureTests.cs (92%) rename test/Microsoft.AspNetCore.Http.Tests/{ => Features}/NonSeekableReadStream.cs (97%) rename test/Microsoft.AspNetCore.Http.Tests/{ => Features}/QueryFeatureTests.cs (93%) rename test/Microsoft.AspNetCore.Http.Tests/{ => Internal}/ApplicationBuilderTests.cs (93%) rename test/Microsoft.AspNetCore.Http.Tests/{ => Internal}/BufferingHelperTests.cs (100%) rename test/Microsoft.AspNetCore.Http.Tests/{ => Internal}/DefaultHttpRequestTests.cs (100%) rename test/Microsoft.AspNetCore.Http.Tests/{ => Internal}/DefaultHttpResponseTests.cs (100%) diff --git a/samples/SampleApp/PooledHttpContext.cs b/samples/SampleApp/PooledHttpContext.cs index 9e124eba..58166bb5 100644 --- a/samples/SampleApp/PooledHttpContext.cs +++ b/samples/SampleApp/PooledHttpContext.cs @@ -12,7 +12,7 @@ public class PooledHttpContext : DefaultHttpContext DefaultHttpRequest _pooledHttpRequest; DefaultHttpResponse _pooledHttpResponse; - public PooledHttpContext(IFeatureCollection featureCollection) : + public PooledHttpContext(IFeatureCollection featureCollection) : base(featureCollection) { } diff --git a/samples/SampleApp/PooledHttpContextFactory.cs b/samples/SampleApp/PooledHttpContextFactory.cs index ca22e011..67433364 100644 --- a/samples/SampleApp/PooledHttpContextFactory.cs +++ b/samples/SampleApp/PooledHttpContextFactory.cs @@ -6,7 +6,6 @@ using System.Text; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Http.Features.Internal; using Microsoft.Extensions.ObjectPool; namespace SampleApp diff --git a/src/Microsoft.AspNetCore.Http.Abstractions/Internal/HeaderSegment.cs b/src/Microsoft.AspNetCore.Http.Abstractions/Internal/HeaderSegment.cs index a1234ff6..a405c7c9 100644 --- a/src/Microsoft.AspNetCore.Http.Abstractions/Internal/HeaderSegment.cs +++ b/src/Microsoft.AspNetCore.Http.Abstractions/Internal/HeaderSegment.cs @@ -4,7 +4,6 @@ using System; using Microsoft.Extensions.Primitives; - namespace Microsoft.AspNetCore.Http.Internal { internal struct HeaderSegment : IEquatable @@ -13,7 +12,7 @@ internal struct HeaderSegment : IEquatable private readonly StringSegment _data; // - // Initializes a new instance of the class. + // Initializes a new instance of the . + /// Gets the number of elements contained in the . /// /// - /// The number of elements contained in the . + /// The number of elements contained in the . /// int Count { get; } /// - /// Gets an containing the keys of the - /// . + /// Gets an containing the keys of the + /// . /// /// - /// An containing the keys of the object - /// that implements . + /// An containing the keys of the object + /// that implements . /// ICollection Keys { get; } /// - /// Determines whether the contains an element + /// Determines whether the contains an element /// with the specified key. /// /// - /// The key to locate in the . + /// The key to locate in the . /// /// - /// true if the contains an element with + /// true if the contains an element with /// the key; otherwise, false. /// - /// + /// /// key is null. /// bool ContainsKey(string key); @@ -58,10 +58,10 @@ public interface IFormCollection : IEnumerable /// - /// true if the object that implements contains + /// true if the object that implements contains /// an element with the specified key; otherwise, false. /// - /// + /// /// key is null. /// bool TryGetValue(string key, out StringValues value); @@ -73,14 +73,14 @@ public interface IFormCollection : IEnumerable /// - /// The element with the specified key, or .Empty if the key is not present. + /// The element with the specified key, or StringValues.Empty if the key is not present. /// - /// + /// /// key is null. /// /// - /// has a different indexer contract than - /// , as it will return StringValues.Empty for missing entries + /// has a different indexer contract than + /// , as it will return StringValues.Empty for missing entries /// rather than throwing an Exception. /// StringValues this[string key] { get; } diff --git a/src/Microsoft.AspNetCore.Http.Features/IQueryCollection.cs b/src/Microsoft.AspNetCore.Http.Features/IQueryCollection.cs index 9df3a780..5d45ad24 100644 --- a/src/Microsoft.AspNetCore.Http.Features/IQueryCollection.cs +++ b/src/Microsoft.AspNetCore.Http.Features/IQueryCollection.cs @@ -12,35 +12,35 @@ namespace Microsoft.AspNetCore.Http public interface IQueryCollection : IEnumerable> { /// - /// Gets the number of elements contained in the . + /// Gets the number of elements contained in the . /// /// - /// The number of elements contained in the . + /// The number of elements contained in the . /// int Count { get; } /// - /// Gets an containing the keys of the - /// . + /// Gets an containing the keys of the + /// . /// /// - /// An containing the keys of the object - /// that implements . + /// An containing the keys of the object + /// that implements . /// ICollection Keys { get; } /// - /// Determines whether the contains an element + /// Determines whether the contains an element /// with the specified key. /// /// - /// The key to locate in the . + /// The key to locate in the . /// /// - /// true if the contains an element with + /// true if the contains an element with /// the key; otherwise, false. /// - /// + /// /// key is null. /// bool ContainsKey(string key); @@ -58,10 +58,10 @@ public interface IQueryCollection : IEnumerable /// - /// true if the object that implements contains + /// true if the object that implements contains /// an element with the specified key; otherwise, false. /// - /// + /// /// key is null. /// bool TryGetValue(string key, out StringValues value); @@ -73,15 +73,14 @@ public interface IQueryCollection : IEnumerable /// - /// The element with the specified key, or . - /// Empty if the key is not present. + /// The element with the specified key, or StringValues.Empty if the key is not present. /// - /// + /// /// key is null. /// /// - /// has a different indexer contract than - /// , as it will return StringValues.Empty for missing entries + /// has a different indexer contract than + /// , as it will return StringValues.Empty for missing entries /// rather than throwing an Exception. /// StringValues this[string key] { get; } diff --git a/src/Microsoft.AspNetCore.Http.Features/IRequestCookieCollection.cs b/src/Microsoft.AspNetCore.Http.Features/IRequestCookieCollection.cs index c1a7344c..6e9444ac 100644 --- a/src/Microsoft.AspNetCore.Http.Features/IRequestCookieCollection.cs +++ b/src/Microsoft.AspNetCore.Http.Features/IRequestCookieCollection.cs @@ -11,35 +11,35 @@ namespace Microsoft.AspNetCore.Http public interface IRequestCookieCollection : IEnumerable> { /// - /// Gets the number of elements contained in the . + /// Gets the number of elements contained in the . /// /// - /// The number of elements contained in the . + /// The number of elements contained in the . /// int Count { get; } /// - /// Gets an containing the keys of the - /// . + /// Gets an containing the keys of the + /// . /// /// - /// An containing the keys of the object - /// that implements . + /// An containing the keys of the object + /// that implements . /// ICollection Keys { get; } /// - /// Determines whether the contains an element + /// Determines whether the contains an element /// with the specified key. /// /// - /// The key to locate in the . + /// The key to locate in the . /// /// - /// true if the contains an element with + /// true if the contains an element with /// the key; otherwise, false. /// - /// + /// /// key is null. /// bool ContainsKey(string key); @@ -57,10 +57,10 @@ public interface IRequestCookieCollection : IEnumerable /// - /// true if the object that implements contains + /// true if the object that implements contains /// an element with the specified key; otherwise, false. /// - /// + /// /// key is null. /// bool TryGetValue(string key, out string value); @@ -72,14 +72,14 @@ public interface IRequestCookieCollection : IEnumerable /// - /// The element with the specified key, or .Empty if the key is not present. + /// The element with the specified key, or string.Empty if the key is not present. /// - /// + /// /// key is null. /// /// - /// has a different indexer contract than - /// , as it will return String.Empty for missing entries + /// has a different indexer contract than + /// , as it will return string.Empty for missing entries /// rather than throwing an Exception. /// string this[string key] { get; } diff --git a/src/Microsoft.AspNetCore.Http/Authentication/DefaultAuthenticationManager.cs b/src/Microsoft.AspNetCore.Http/Authentication/DefaultAuthenticationManager.cs index 24eb05e7..a9f79ba6 100644 --- a/src/Microsoft.AspNetCore.Http/Authentication/DefaultAuthenticationManager.cs +++ b/src/Microsoft.AspNetCore.Http/Authentication/DefaultAuthenticationManager.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features.Authentication; -using Microsoft.AspNetCore.Http.Features.Authentication.Internal; namespace Microsoft.AspNetCore.Http.Authentication.Internal { diff --git a/src/Microsoft.AspNetCore.Http/DefaultHttpContext.cs b/src/Microsoft.AspNetCore.Http/DefaultHttpContext.cs index 4e99c529..7feb5324 100644 --- a/src/Microsoft.AspNetCore.Http/DefaultHttpContext.cs +++ b/src/Microsoft.AspNetCore.Http/DefaultHttpContext.cs @@ -9,10 +9,9 @@ using Microsoft.AspNetCore.Http.Authentication.Internal; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features.Authentication; -using Microsoft.AspNetCore.Http.Features.Authentication.Internal; -using Microsoft.AspNetCore.Http.Features.Internal; +using Microsoft.AspNetCore.Http.Internal; -namespace Microsoft.AspNetCore.Http.Internal +namespace Microsoft.AspNetCore.Http { public class DefaultHttpContext : HttpContext { @@ -72,7 +71,7 @@ public virtual void Uninitialize() _websockets = null; } } - + private IItemsFeature ItemsFeature => _features.Fetch(ref _features.Cache.Items, f => new ItemsFeature()); @@ -165,7 +164,7 @@ public override ISession Session } } - + public override void Abort() { diff --git a/src/Microsoft.AspNetCore.Http/Features/Authentication/HttpAuthenticationFeature.cs b/src/Microsoft.AspNetCore.Http/Features/Authentication/HttpAuthenticationFeature.cs index f3fd2288..9a14b657 100644 --- a/src/Microsoft.AspNetCore.Http/Features/Authentication/HttpAuthenticationFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/Authentication/HttpAuthenticationFeature.cs @@ -3,14 +3,10 @@ using System.Security.Claims; -namespace Microsoft.AspNetCore.Http.Features.Authentication.Internal +namespace Microsoft.AspNetCore.Http.Features.Authentication { public class HttpAuthenticationFeature : IHttpAuthenticationFeature { - public HttpAuthenticationFeature() - { - } - public ClaimsPrincipal User { get; diff --git a/src/Microsoft.AspNetCore.Http/Features/DefaultSessionFeature.cs b/src/Microsoft.AspNetCore.Http/Features/DefaultSessionFeature.cs index 374e4dcd..67901334 100644 --- a/src/Microsoft.AspNetCore.Http/Features/DefaultSessionFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/DefaultSessionFeature.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { /// /// This type exists only for the purpose of unit testing where the user can directly set the diff --git a/src/Microsoft.AspNetCore.Http/Features/FormFeature.cs b/src/Microsoft.AspNetCore.Http/Features/FormFeature.cs index 1a9f00fa..d4fa7977 100644 --- a/src/Microsoft.AspNetCore.Http/Features/FormFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/FormFeature.cs @@ -10,7 +10,7 @@ using Microsoft.AspNetCore.WebUtilities; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class FormFeature : IFormFeature { diff --git a/src/Microsoft.AspNetCore.Http/Features/HttpConnectionFeature.cs b/src/Microsoft.AspNetCore.Http/Features/HttpConnectionFeature.cs index ab688ec7..2e8d5b0a 100644 --- a/src/Microsoft.AspNetCore.Http/Features/HttpConnectionFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/HttpConnectionFeature.cs @@ -3,14 +3,10 @@ using System.Net; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class HttpConnectionFeature : IHttpConnectionFeature { - public HttpConnectionFeature() - { - } - public string ConnectionId { get; set; } public IPAddress LocalIpAddress { get; set; } diff --git a/src/Microsoft.AspNetCore.Http/Features/HttpRequestFeature.cs b/src/Microsoft.AspNetCore.Http/Features/HttpRequestFeature.cs index b85484b8..c23051f6 100644 --- a/src/Microsoft.AspNetCore.Http/Features/HttpRequestFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/HttpRequestFeature.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.IO; -using Microsoft.AspNetCore.Http.Internal; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class HttpRequestFeature : IHttpRequestFeature { diff --git a/src/Microsoft.AspNetCore.Http/Features/HttpRequestIdentifierFeature.cs b/src/Microsoft.AspNetCore.Http/Features/HttpRequestIdentifierFeature.cs index 289ecbdc..34663937 100644 --- a/src/Microsoft.AspNetCore.Http/Features/HttpRequestIdentifierFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/HttpRequestIdentifierFeature.cs @@ -4,7 +4,7 @@ using System; using System.Threading; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class HttpRequestIdentifierFeature : IHttpRequestIdentifierFeature { diff --git a/src/Microsoft.AspNetCore.Http/Features/HttpRequestLifetimeFeature.cs b/src/Microsoft.AspNetCore.Http/Features/HttpRequestLifetimeFeature.cs index 17e6ec31..df327d07 100644 --- a/src/Microsoft.AspNetCore.Http/Features/HttpRequestLifetimeFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/HttpRequestLifetimeFeature.cs @@ -3,7 +3,7 @@ using System.Threading; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class HttpRequestLifetimeFeature : IHttpRequestLifetimeFeature { diff --git a/src/Microsoft.AspNetCore.Http/Features/HttpResponseFeature.cs b/src/Microsoft.AspNetCore.Http/Features/HttpResponseFeature.cs index ef8f845c..d0cb806b 100644 --- a/src/Microsoft.AspNetCore.Http/Features/HttpResponseFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/HttpResponseFeature.cs @@ -4,9 +4,8 @@ using System; using System.IO; using System.Threading.Tasks; -using Microsoft.AspNetCore.Http.Internal; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class HttpResponseFeature : IHttpResponseFeature { diff --git a/src/Microsoft.AspNetCore.Http/Features/ItemsFeature.cs b/src/Microsoft.AspNetCore.Http/Features/ItemsFeature.cs index e4346667..6bf0669b 100644 --- a/src/Microsoft.AspNetCore.Http/Features/ItemsFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/ItemsFeature.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Http.Internal; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class ItemsFeature : IItemsFeature { diff --git a/src/Microsoft.AspNetCore.Http/Features/QueryFeature.cs b/src/Microsoft.AspNetCore.Http/Features/QueryFeature.cs index 015fba56..92d9aaa3 100644 --- a/src/Microsoft.AspNetCore.Http/Features/QueryFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/QueryFeature.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Http.Internal; using Microsoft.AspNetCore.WebUtilities; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class QueryFeature : IQueryFeature { diff --git a/src/Microsoft.AspNetCore.Http/Features/RequestCookiesFeature.cs b/src/Microsoft.AspNetCore.Http/Features/RequestCookiesFeature.cs index 0102ab7f..49ae5506 100644 --- a/src/Microsoft.AspNetCore.Http/Features/RequestCookiesFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/RequestCookiesFeature.cs @@ -7,14 +7,14 @@ using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class RequestCookiesFeature : IRequestCookiesFeature { private FeatureReferences _features; private StringValues _original; private IRequestCookieCollection _parsedValues; - + public RequestCookiesFeature(IRequestCookieCollection cookies) { if (cookies == null) diff --git a/src/Microsoft.AspNetCore.Http/Features/ResponseCookiesFeature.cs b/src/Microsoft.AspNetCore.Http/Features/ResponseCookiesFeature.cs index 9481ac0a..59b8f68b 100644 --- a/src/Microsoft.AspNetCore.Http/Features/ResponseCookiesFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/ResponseCookiesFeature.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Http.Internal; using Microsoft.Extensions.ObjectPool; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { /// /// Default implementation of . diff --git a/src/Microsoft.AspNetCore.Http/Features/ServiceProvidersFeature.cs b/src/Microsoft.AspNetCore.Http/Features/ServiceProvidersFeature.cs index 3cd172a0..d1cf4e6c 100644 --- a/src/Microsoft.AspNetCore.Http/Features/ServiceProvidersFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/ServiceProvidersFeature.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class ServiceProvidersFeature : IServiceProvidersFeature { diff --git a/src/Microsoft.AspNetCore.Http/Features/TlsConnectionFeature.cs b/src/Microsoft.AspNetCore.Http/Features/TlsConnectionFeature.cs index 081cf97b..f9bfcdef 100644 --- a/src/Microsoft.AspNetCore.Http/Features/TlsConnectionFeature.cs +++ b/src/Microsoft.AspNetCore.Http/Features/TlsConnectionFeature.cs @@ -5,14 +5,10 @@ using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class TlsConnectionFeature : ITlsConnectionFeature { - public TlsConnectionFeature() - { - } - public X509Certificate2 ClientCertificate { get; set; } public Task GetClientCertificateAsync(CancellationToken cancellationToken) diff --git a/src/Microsoft.AspNetCore.Http/FormCollection.cs b/src/Microsoft.AspNetCore.Http/FormCollection.cs index 6e44c39a..564fdcbb 100644 --- a/src/Microsoft.AspNetCore.Http/FormCollection.cs +++ b/src/Microsoft.AspNetCore.Http/FormCollection.cs @@ -4,9 +4,10 @@ using System; using System.Collections; using System.Collections.Generic; +using Microsoft.AspNetCore.Http.Internal; using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.Http.Internal +namespace Microsoft.AspNetCore.Http { /// /// Contains the parsed form values. @@ -20,7 +21,7 @@ public class FormCollection : IFormCollection #else private static readonly string[] EmptyKeys = new string[0]; private static readonly StringValues[] EmptyValues = new StringValues[0]; -#endif +#endif private static readonly Enumerator EmptyEnumerator = new Enumerator(); // Pre-box private static readonly IEnumerator> EmptyIEnumeratorType = EmptyEnumerator; @@ -77,9 +78,9 @@ public StringValues this[string key] } /// - /// Gets the number of elements contained in the ;. + /// Gets the number of elements contained in the ;. /// - /// The number of elements contained in the . + /// The number of elements contained in the . public int Count { get @@ -101,10 +102,10 @@ public ICollection Keys } /// - /// Determines whether the contains a specific key. + /// Determines whether the contains a specific key. /// /// The key. - /// true if the contains a specific key; otherwise, false. + /// true if the contains a specific key; otherwise, false. public bool ContainsKey(string key) { if (Store == null) @@ -119,7 +120,7 @@ public bool ContainsKey(string key) /// /// The header name. /// The value. - /// true if the contains the key; otherwise, false. + /// true if the contains the key; otherwise, false. public bool TryGetValue(string key, out StringValues value) { if (Store == null) @@ -131,9 +132,9 @@ public bool TryGetValue(string key, out StringValues value) } /// - /// Returns an struct enumerator that iterates through a collection without boxing and is also used via the interface. + /// Returns an struct enumerator that iterates through a collection without boxing and is also used via the interface. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. public Enumerator GetEnumerator() { if (Store == null || Store.Count == 0) @@ -148,7 +149,7 @@ public Enumerator GetEnumerator() /// /// Returns an enumerator that iterates through a collection, boxes in non-empty path. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. IEnumerator> IEnumerable>.GetEnumerator() { if (Store == null || Store.Count == 0) @@ -163,7 +164,7 @@ IEnumerator> IEnumerable /// Returns an enumerator that iterates through a collection, boxes in non-empty path. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. IEnumerator IEnumerable.GetEnumerator() { if (Store == null || Store.Count == 0) diff --git a/src/Microsoft.AspNetCore.Http/HeaderDictionary.cs b/src/Microsoft.AspNetCore.Http/HeaderDictionary.cs index 30445745..6fc02201 100644 --- a/src/Microsoft.AspNetCore.Http/HeaderDictionary.cs +++ b/src/Microsoft.AspNetCore.Http/HeaderDictionary.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.Http.Internal +namespace Microsoft.AspNetCore.Http { /// /// Represents a wrapper for RequestHeaders and ResponseHeaders. @@ -19,13 +19,13 @@ public class HeaderDictionary : IHeaderDictionary #else private static readonly string[] EmptyKeys = new string[0]; private static readonly StringValues[] EmptyValues = new StringValues[0]; -#endif +#endif private static readonly Enumerator EmptyEnumerator = new Enumerator(); // Pre-box private static readonly IEnumerator> EmptyIEnumeratorType = EmptyEnumerator; private static readonly IEnumerator EmptyIEnumerator = EmptyEnumerator; - public HeaderDictionary() + public HeaderDictionary() { } @@ -98,9 +98,9 @@ StringValues IDictionary.this[string key] } /// - /// Gets the number of elements contained in the ;. + /// Gets the number of elements contained in the ;. /// - /// The number of elements contained in the . + /// The number of elements contained in the . public int Count { get @@ -110,9 +110,9 @@ public int Count } /// - /// Gets a value that indicates whether the is in read-only mode. + /// Gets a value that indicates whether the is in read-only mode. /// - /// true if the is in read-only mode; otherwise, false. + /// true if the is in read-only mode; otherwise, false. public bool IsReadOnly { get @@ -207,10 +207,10 @@ public bool Contains(KeyValuePair item) } /// - /// Determines whether the contains a specific key. + /// Determines whether the contains a specific key. /// /// The key. - /// true if the contains a specific key; otherwise, false. + /// true if the contains a specific key; otherwise, false. public bool ContainsKey(string key) { if (Store == null) @@ -221,9 +221,9 @@ public bool ContainsKey(string key) } /// - /// Copies the elements to a one-dimensional Array instance at the specified index. + /// Copies the elements to a one-dimensional Array instance at the specified index. /// - /// The one-dimensional Array that is the destination of the specified objects copied from the . + /// The one-dimensional Array that is the destination of the specified objects copied from the . /// The zero-based index in at which copying begins. public void CopyTo(KeyValuePair[] array, int arrayIndex) { @@ -279,7 +279,7 @@ public bool Remove(string key) /// /// The header name. /// The value. - /// true if the contains the key; otherwise, false. + /// true if the contains the key; otherwise, false. public bool TryGetValue(string key, out StringValues value) { if (Store == null) @@ -293,7 +293,7 @@ public bool TryGetValue(string key, out StringValues value) /// /// Returns an enumerator that iterates through a collection. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. public Enumerator GetEnumerator() { if (Store == null || Store.Count == 0) @@ -307,7 +307,7 @@ public Enumerator GetEnumerator() /// /// Returns an enumerator that iterates through a collection. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. IEnumerator> IEnumerable>.GetEnumerator() { if (Store == null || Store.Count == 0) @@ -321,7 +321,7 @@ IEnumerator> IEnumerable /// Returns an enumerator that iterates through a collection. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. IEnumerator IEnumerable.GetEnumerator() { if (Store == null || Store.Count == 0) diff --git a/src/Microsoft.AspNetCore.Http/HttpContextAccessor.cs b/src/Microsoft.AspNetCore.Http/HttpContextAccessor.cs index be6bb471..9bb3dc37 100644 --- a/src/Microsoft.AspNetCore.Http/HttpContextAccessor.cs +++ b/src/Microsoft.AspNetCore.Http/HttpContextAccessor.cs @@ -1,15 +1,14 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; #if NET451 -using System.Runtime.Remoting.Messaging; using System.Runtime.Remoting; +using System.Runtime.Remoting.Messaging; #elif NETSTANDARD1_3 using System.Threading; #endif -namespace Microsoft.AspNetCore.Http.Internal +namespace Microsoft.AspNetCore.Http { public class HttpContextAccessor : IHttpContextAccessor { diff --git a/src/Microsoft.AspNetCore.Http/HttpContextFactory.cs b/src/Microsoft.AspNetCore.Http/HttpContextFactory.cs index 95efc68b..7acd6a96 100644 --- a/src/Microsoft.AspNetCore.Http/HttpContextFactory.cs +++ b/src/Microsoft.AspNetCore.Http/HttpContextFactory.cs @@ -4,10 +4,9 @@ using System; using System.Text; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Http.Features.Internal; using Microsoft.Extensions.ObjectPool; -namespace Microsoft.AspNetCore.Http.Internal +namespace Microsoft.AspNetCore.Http { public class HttpContextFactory : IHttpContextFactory { diff --git a/src/Microsoft.AspNetCore.Http/ApplicationBuilder.cs b/src/Microsoft.AspNetCore.Http/Internal/ApplicationBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.Http/ApplicationBuilder.cs rename to src/Microsoft.AspNetCore.Http/Internal/ApplicationBuilder.cs diff --git a/src/Microsoft.AspNetCore.Http/BufferingHelper.cs b/src/Microsoft.AspNetCore.Http/Internal/BufferingHelper.cs similarity index 100% rename from src/Microsoft.AspNetCore.Http/BufferingHelper.cs rename to src/Microsoft.AspNetCore.Http/Internal/BufferingHelper.cs diff --git a/src/Microsoft.AspNetCore.Http/Constants.cs b/src/Microsoft.AspNetCore.Http/Internal/Constants.cs similarity index 100% rename from src/Microsoft.AspNetCore.Http/Constants.cs rename to src/Microsoft.AspNetCore.Http/Internal/Constants.cs diff --git a/src/Microsoft.AspNetCore.Http/DefaultConnectionInfo.cs b/src/Microsoft.AspNetCore.Http/Internal/DefaultConnectionInfo.cs similarity index 98% rename from src/Microsoft.AspNetCore.Http/DefaultConnectionInfo.cs rename to src/Microsoft.AspNetCore.Http/Internal/DefaultConnectionInfo.cs index 35c8c584..02db7076 100644 --- a/src/Microsoft.AspNetCore.Http/DefaultConnectionInfo.cs +++ b/src/Microsoft.AspNetCore.Http/Internal/DefaultConnectionInfo.cs @@ -6,7 +6,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Http.Features.Internal; namespace Microsoft.AspNetCore.Http.Internal { diff --git a/src/Microsoft.AspNetCore.Http/DefaultHttpRequest.cs b/src/Microsoft.AspNetCore.Http/Internal/DefaultHttpRequest.cs similarity index 98% rename from src/Microsoft.AspNetCore.Http/DefaultHttpRequest.cs rename to src/Microsoft.AspNetCore.Http/Internal/DefaultHttpRequest.cs index 2d5abcf7..f761cec1 100644 --- a/src/Microsoft.AspNetCore.Http/DefaultHttpRequest.cs +++ b/src/Microsoft.AspNetCore.Http/Internal/DefaultHttpRequest.cs @@ -6,7 +6,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Http.Features.Internal; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Http.Internal diff --git a/src/Microsoft.AspNetCore.Http/DefaultHttpResponse.cs b/src/Microsoft.AspNetCore.Http/Internal/DefaultHttpResponse.cs similarity index 98% rename from src/Microsoft.AspNetCore.Http/DefaultHttpResponse.cs rename to src/Microsoft.AspNetCore.Http/Internal/DefaultHttpResponse.cs index 6105ff1c..2073f825 100644 --- a/src/Microsoft.AspNetCore.Http/DefaultHttpResponse.cs +++ b/src/Microsoft.AspNetCore.Http/Internal/DefaultHttpResponse.cs @@ -5,7 +5,6 @@ using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Http.Features.Internal; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Http.Internal @@ -37,7 +36,7 @@ public virtual void Uninitialize() private IResponseCookiesFeature ResponseCookiesFeature => _features.Fetch(ref _features.Cache.Cookies, f => new ResponseCookiesFeature(f)); - + public override HttpContext HttpContext { get { return _context; } } diff --git a/src/Microsoft.AspNetCore.Http/DefaultWebSocketManager.cs b/src/Microsoft.AspNetCore.Http/Internal/DefaultWebSocketManager.cs similarity index 100% rename from src/Microsoft.AspNetCore.Http/DefaultWebSocketManager.cs rename to src/Microsoft.AspNetCore.Http/Internal/DefaultWebSocketManager.cs diff --git a/src/Microsoft.AspNetCore.Http/Features/FormFile.cs b/src/Microsoft.AspNetCore.Http/Internal/FormFile.cs similarity index 97% rename from src/Microsoft.AspNetCore.Http/Features/FormFile.cs rename to src/Microsoft.AspNetCore.Http/Internal/FormFile.cs index 3a7b3415..b4a3f4d9 100644 --- a/src/Microsoft.AspNetCore.Http/Features/FormFile.cs +++ b/src/Microsoft.AspNetCore.Http/Internal/FormFile.cs @@ -5,9 +5,8 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Http.Internal; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Internal { public class FormFile : IFormFile { diff --git a/src/Microsoft.AspNetCore.Http/FormFileCollection.cs b/src/Microsoft.AspNetCore.Http/Internal/FormFileCollection.cs similarity index 100% rename from src/Microsoft.AspNetCore.Http/FormFileCollection.cs rename to src/Microsoft.AspNetCore.Http/Internal/FormFileCollection.cs diff --git a/src/Microsoft.AspNetCore.Http/ItemsDictionary.cs b/src/Microsoft.AspNetCore.Http/Internal/ItemsDictionary.cs similarity index 100% rename from src/Microsoft.AspNetCore.Http/ItemsDictionary.cs rename to src/Microsoft.AspNetCore.Http/Internal/ItemsDictionary.cs diff --git a/src/Microsoft.AspNetCore.Http/ParsingHelpers.cs b/src/Microsoft.AspNetCore.Http/Internal/ParsingHelpers.cs similarity index 99% rename from src/Microsoft.AspNetCore.Http/ParsingHelpers.cs rename to src/Microsoft.AspNetCore.Http/Internal/ParsingHelpers.cs index 7a018ebd..5e406d85 100644 --- a/src/Microsoft.AspNetCore.Http/ParsingHelpers.cs +++ b/src/Microsoft.AspNetCore.Http/Internal/ParsingHelpers.cs @@ -17,7 +17,7 @@ internal struct HeaderSegment : IEquatable private readonly StringSegment _data; // - // Initializes a new instance of the class. + // Initializes a new instance of the structure. // public HeaderSegment(StringSegment formatting, StringSegment data) { diff --git a/src/Microsoft.AspNetCore.Http/QueryCollection.cs b/src/Microsoft.AspNetCore.Http/Internal/QueryCollection.cs similarity index 86% rename from src/Microsoft.AspNetCore.Http/QueryCollection.cs rename to src/Microsoft.AspNetCore.Http/Internal/QueryCollection.cs index 1809635d..f2db4a87 100644 --- a/src/Microsoft.AspNetCore.Http/QueryCollection.cs +++ b/src/Microsoft.AspNetCore.Http/Internal/QueryCollection.cs @@ -20,7 +20,7 @@ public class QueryCollection : IQueryCollection #else private static readonly string[] EmptyKeys = new string[0]; private static readonly StringValues[] EmptyValues = new StringValues[0]; -#endif +#endif private static readonly Enumerator EmptyEnumerator = new Enumerator(); // Pre-box private static readonly IEnumerator> EmptyIEnumeratorType = EmptyEnumerator; @@ -28,7 +28,7 @@ public class QueryCollection : IQueryCollection private Dictionary Store { get; set; } - public QueryCollection() + public QueryCollection() { } @@ -71,9 +71,9 @@ public StringValues this[string key] } /// - /// Gets the number of elements contained in the ;. + /// Gets the number of elements contained in the ;. /// - /// The number of elements contained in the . + /// The number of elements contained in the . public int Count { get @@ -99,10 +99,10 @@ public ICollection Keys } /// - /// Determines whether the contains a specific key. + /// Determines whether the contains a specific key. /// /// The key. - /// true if the contains a specific key; otherwise, false. + /// true if the contains a specific key; otherwise, false. public bool ContainsKey(string key) { if (Store == null) @@ -117,7 +117,7 @@ public bool ContainsKey(string key) /// /// The header name. /// The value. - /// true if the contains the key; otherwise, false. + /// true if the contains the key; otherwise, false. public bool TryGetValue(string key, out StringValues value) { if (Store == null) @@ -131,7 +131,7 @@ public bool TryGetValue(string key, out StringValues value) /// /// Returns an enumerator that iterates through a collection. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. public Enumerator GetEnumerator() { if (Store == null || Store.Count == 0) @@ -145,7 +145,7 @@ public Enumerator GetEnumerator() /// /// Returns an enumerator that iterates through a collection. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. IEnumerator> IEnumerable>.GetEnumerator() { if (Store == null || Store.Count == 0) @@ -159,7 +159,7 @@ IEnumerator> IEnumerable /// Returns an enumerator that iterates through a collection. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. IEnumerator IEnumerable.GetEnumerator() { if (Store == null || Store.Count == 0) diff --git a/src/Microsoft.AspNetCore.Http/ReferenceReadStream.cs b/src/Microsoft.AspNetCore.Http/Internal/ReferenceReadStream.cs similarity index 100% rename from src/Microsoft.AspNetCore.Http/ReferenceReadStream.cs rename to src/Microsoft.AspNetCore.Http/Internal/ReferenceReadStream.cs diff --git a/src/Microsoft.AspNetCore.Http/RequestCookieCollection.cs b/src/Microsoft.AspNetCore.Http/Internal/RequestCookieCollection.cs similarity index 92% rename from src/Microsoft.AspNetCore.Http/RequestCookieCollection.cs rename to src/Microsoft.AspNetCore.Http/Internal/RequestCookieCollection.cs index 68a2f359..afc34489 100644 --- a/src/Microsoft.AspNetCore.Http/RequestCookieCollection.cs +++ b/src/Microsoft.AspNetCore.Http/Internal/RequestCookieCollection.cs @@ -15,7 +15,7 @@ public class RequestCookieCollection : IRequestCookieCollection private static readonly string[] EmptyKeys = Array.Empty(); #else private static readonly string[] EmptyKeys = new string[0]; -#endif +#endif private static readonly Enumerator EmptyEnumerator = new Enumerator(); // Pre-box private static readonly IEnumerator> EmptyIEnumeratorType = EmptyEnumerator; @@ -59,7 +59,7 @@ public string this[string key] return null; } } - + public static RequestCookieCollection Parse(IList values) { if (values.Count == 0) @@ -135,7 +135,7 @@ public bool TryGetValue(string key, out string value) /// /// Returns an struct enumerator that iterates through a collection without boxing. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. public Enumerator GetEnumerator() { if (Store == null || Store.Count == 0) @@ -150,7 +150,7 @@ public Enumerator GetEnumerator() /// /// Returns an enumerator that iterates through a collection, boxes in non-empty path. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. IEnumerator> IEnumerable>.GetEnumerator() { if (Store == null || Store.Count == 0) @@ -159,13 +159,13 @@ IEnumerator> IEnumerable /// Returns an enumerator that iterates through a collection, boxes in non-empty path. /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. IEnumerator IEnumerable.GetEnumerator() { if (Store == null || Store.Count == 0) @@ -176,7 +176,7 @@ IEnumerator IEnumerable.GetEnumerator() // Boxed Enumerator return GetEnumerator(); } - + public struct Enumerator : IEnumerator> { // Do NOT make this readonly, or MoveNext will not work diff --git a/src/Microsoft.AspNetCore.Http/ResponseCookies.cs b/src/Microsoft.AspNetCore.Http/Internal/ResponseCookies.cs similarity index 100% rename from src/Microsoft.AspNetCore.Http/ResponseCookies.cs rename to src/Microsoft.AspNetCore.Http/Internal/ResponseCookies.cs diff --git a/src/Microsoft.AspNetCore.Owin/OwinEnvironment.cs b/src/Microsoft.AspNetCore.Owin/OwinEnvironment.cs index fb0d9542..45bd5884 100644 --- a/src/Microsoft.AspNetCore.Owin/OwinEnvironment.cs +++ b/src/Microsoft.AspNetCore.Owin/OwinEnvironment.cs @@ -17,8 +17,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features.Authentication; -using Microsoft.AspNetCore.Http.Features.Authentication.Internal; -using Microsoft.AspNetCore.Http.Features.Internal; namespace Microsoft.AspNetCore.Owin { diff --git a/src/Microsoft.AspNetCore.Owin/OwinExtensions.cs b/src/Microsoft.AspNetCore.Owin/OwinExtensions.cs index a06530cd..0344c1a5 100644 --- a/src/Microsoft.AspNetCore.Owin/OwinExtensions.cs +++ b/src/Microsoft.AspNetCore.Owin/OwinExtensions.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Builder.Internal; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Http.Internal; using Microsoft.AspNetCore.Owin; namespace Microsoft.AspNetCore.Builder diff --git a/test/Microsoft.AspNetCore.Http.Abstractions.Tests/HttpResponseWritingExtensionsTests.cs b/test/Microsoft.AspNetCore.Http.Abstractions.Tests/HttpResponseWritingExtensionsTests.cs index 42ca2a22..f8e9e27d 100644 --- a/test/Microsoft.AspNetCore.Http.Abstractions.Tests/HttpResponseWritingExtensionsTests.cs +++ b/test/Microsoft.AspNetCore.Http.Abstractions.Tests/HttpResponseWritingExtensionsTests.cs @@ -3,7 +3,6 @@ using System.IO; using System.Threading.Tasks; -using Microsoft.AspNetCore.Http.Internal; using Xunit; namespace Microsoft.AspNetCore.Http diff --git a/test/Microsoft.AspNetCore.Http.Abstractions.Tests/MapPathMiddlewareTests.cs b/test/Microsoft.AspNetCore.Http.Abstractions.Tests/MapPathMiddlewareTests.cs index a7966947..aaee3cc3 100644 --- a/test/Microsoft.AspNetCore.Http.Abstractions.Tests/MapPathMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.Http.Abstractions.Tests/MapPathMiddlewareTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Builder.Internal; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Internal; using Xunit; namespace Microsoft.AspNetCore.Builder.Extensions diff --git a/test/Microsoft.AspNetCore.Http.Abstractions.Tests/MapPredicateMiddlewareTests.cs b/test/Microsoft.AspNetCore.Http.Abstractions.Tests/MapPredicateMiddlewareTests.cs index b970ee8d..0313a730 100644 --- a/test/Microsoft.AspNetCore.Http.Abstractions.Tests/MapPredicateMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.Http.Abstractions.Tests/MapPredicateMiddlewareTests.cs @@ -2,11 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder.Internal; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Internal; using Xunit; namespace Microsoft.AspNetCore.Builder.Extensions diff --git a/test/Microsoft.AspNetCore.Http.Abstractions.Tests/UseMiddlewareTest.cs b/test/Microsoft.AspNetCore.Http.Abstractions.Tests/UseMiddlewareTest.cs index f1b6e327..ce197e0c 100644 --- a/test/Microsoft.AspNetCore.Http.Abstractions.Tests/UseMiddlewareTest.cs +++ b/test/Microsoft.AspNetCore.Http.Abstractions.Tests/UseMiddlewareTest.cs @@ -6,7 +6,6 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder.Internal; using Microsoft.AspNetCore.Http.Abstractions; -using Microsoft.AspNetCore.Http.Internal; using Xunit; namespace Microsoft.AspNetCore.Http diff --git a/test/Microsoft.AspNetCore.Http.Extensions.Tests/HeaderDictionaryTypeExtensionsTest.cs b/test/Microsoft.AspNetCore.Http.Extensions.Tests/HeaderDictionaryTypeExtensionsTest.cs index 4161625e..1d014662 100644 --- a/test/Microsoft.AspNetCore.Http.Extensions.Tests/HeaderDictionaryTypeExtensionsTest.cs +++ b/test/Microsoft.AspNetCore.Http.Extensions.Tests/HeaderDictionaryTypeExtensionsTest.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.AspNetCore.Http.Internal; using Microsoft.Net.Http.Headers; using Xunit; diff --git a/test/Microsoft.AspNetCore.Http.Extensions.Tests/ResponseExtensionTests.cs b/test/Microsoft.AspNetCore.Http.Extensions.Tests/ResponseExtensionTests.cs index d63f2b84..ae6b147f 100644 --- a/test/Microsoft.AspNetCore.Http.Extensions.Tests/ResponseExtensionTests.cs +++ b/test/Microsoft.AspNetCore.Http.Extensions.Tests/ResponseExtensionTests.cs @@ -2,12 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Http.Internal; -using Microsoft.Extensions.Primitives; using Xunit; namespace Microsoft.AspNetCore.Http.Extensions diff --git a/test/Microsoft.AspNetCore.Http.Extensions.Tests/SendFileResponseExtensionsTests.cs b/test/Microsoft.AspNetCore.Http.Extensions.Tests/SendFileResponseExtensionsTests.cs index c1e145c3..f4c7c0f2 100644 --- a/test/Microsoft.AspNetCore.Http.Extensions.Tests/SendFileResponseExtensionsTests.cs +++ b/test/Microsoft.AspNetCore.Http.Extensions.Tests/SendFileResponseExtensionsTests.cs @@ -1,11 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. -using System; using System.IO; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Http.Internal; using Xunit; namespace Microsoft.AspNetCore.Http.Extensions.Tests diff --git a/test/Microsoft.AspNetCore.Http.Extensions.Tests/UriHelperTests.cs b/test/Microsoft.AspNetCore.Http.Extensions.Tests/UriHelperTests.cs index 7bd7159b..06c4f4a3 100644 --- a/test/Microsoft.AspNetCore.Http.Extensions.Tests/UriHelperTests.cs +++ b/test/Microsoft.AspNetCore.Http.Extensions.Tests/UriHelperTests.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Http.Internal; using Xunit; namespace Microsoft.AspNetCore.Http.Extensions diff --git a/test/Microsoft.AspNetCore.Http.Tests/Authentication/DefaultAuthenticationManagerTests.cs b/test/Microsoft.AspNetCore.Http.Tests/Authentication/DefaultAuthenticationManagerTests.cs index 3d547ea0..85968a94 100644 --- a/test/Microsoft.AspNetCore.Http.Tests/Authentication/DefaultAuthenticationManagerTests.cs +++ b/test/Microsoft.AspNetCore.Http.Tests/Authentication/DefaultAuthenticationManagerTests.cs @@ -4,10 +4,7 @@ using System; using System.Security.Claims; using System.Threading.Tasks; -using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features.Authentication; -using Microsoft.AspNetCore.Http.Features.Authentication.Internal; -using Microsoft.AspNetCore.Http.Internal; using Xunit; namespace Microsoft.AspNetCore.Http.Authentication.Internal diff --git a/test/Microsoft.AspNetCore.Http.Tests/DefaultHttpContextTests.cs b/test/Microsoft.AspNetCore.Http.Tests/DefaultHttpContextTests.cs index fe58c810..b88e90a5 100644 --- a/test/Microsoft.AspNetCore.Http.Tests/DefaultHttpContextTests.cs +++ b/test/Microsoft.AspNetCore.Http.Tests/DefaultHttpContextTests.cs @@ -9,10 +9,9 @@ using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Http.Features.Internal; using Xunit; -namespace Microsoft.AspNetCore.Http.Internal +namespace Microsoft.AspNetCore.Http { public class DefaultHttpContextTests { diff --git a/test/Microsoft.AspNetCore.Http.Tests/FakeResponseFeature.cs b/test/Microsoft.AspNetCore.Http.Tests/Features/FakeResponseFeature.cs similarity index 89% rename from test/Microsoft.AspNetCore.Http.Tests/FakeResponseFeature.cs rename to test/Microsoft.AspNetCore.Http.Tests/Features/FakeResponseFeature.cs index 10cd5cc6..43a7acab 100644 --- a/test/Microsoft.AspNetCore.Http.Tests/FakeResponseFeature.cs +++ b/test/Microsoft.AspNetCore.Http.Tests/Features/FakeResponseFeature.cs @@ -4,9 +4,8 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.AspNetCore.Http.Features.Internal; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class FakeResponseFeature : HttpResponseFeature { diff --git a/test/Microsoft.AspNetCore.Http.Tests/FormFeatureTests.cs b/test/Microsoft.AspNetCore.Http.Tests/Features/FormFeatureTests.cs similarity index 99% rename from test/Microsoft.AspNetCore.Http.Tests/FormFeatureTests.cs rename to test/Microsoft.AspNetCore.Http.Tests/Features/FormFeatureTests.cs index 280e7777..e4f01b86 100644 --- a/test/Microsoft.AspNetCore.Http.Tests/FormFeatureTests.cs +++ b/test/Microsoft.AspNetCore.Http.Tests/Features/FormFeatureTests.cs @@ -9,7 +9,7 @@ using Microsoft.AspNetCore.WebUtilities; using Xunit; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class FormFeatureTests { diff --git a/test/Microsoft.AspNetCore.Http.Tests/HttpRequestIdentifierFeatureTests.cs b/test/Microsoft.AspNetCore.Http.Tests/Features/HttpRequestIdentifierFeatureTests.cs similarity index 92% rename from test/Microsoft.AspNetCore.Http.Tests/HttpRequestIdentifierFeatureTests.cs rename to test/Microsoft.AspNetCore.Http.Tests/Features/HttpRequestIdentifierFeatureTests.cs index 95c3f39f..7b17028c 100644 --- a/test/Microsoft.AspNetCore.Http.Tests/HttpRequestIdentifierFeatureTests.cs +++ b/test/Microsoft.AspNetCore.Http.Tests/Features/HttpRequestIdentifierFeatureTests.cs @@ -1,10 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Http.Features.Internal; using Xunit; -namespace Microsoft.AspNetCore.Http.Tests +namespace Microsoft.AspNetCore.Http.Features { public class HttpRequestIdentifierFeatureTests { diff --git a/test/Microsoft.AspNetCore.Http.Tests/NonSeekableReadStream.cs b/test/Microsoft.AspNetCore.Http.Tests/Features/NonSeekableReadStream.cs similarity index 97% rename from test/Microsoft.AspNetCore.Http.Tests/NonSeekableReadStream.cs rename to test/Microsoft.AspNetCore.Http.Tests/Features/NonSeekableReadStream.cs index 2e6af5ab..279da799 100644 --- a/test/Microsoft.AspNetCore.Http.Tests/NonSeekableReadStream.cs +++ b/test/Microsoft.AspNetCore.Http.Tests/Features/NonSeekableReadStream.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class NonSeekableReadStream : Stream { diff --git a/test/Microsoft.AspNetCore.Http.Tests/QueryFeatureTests.cs b/test/Microsoft.AspNetCore.Http.Tests/Features/QueryFeatureTests.cs similarity index 93% rename from test/Microsoft.AspNetCore.Http.Tests/QueryFeatureTests.cs rename to test/Microsoft.AspNetCore.Http.Tests/Features/QueryFeatureTests.cs index c56b4962..0b939978 100644 --- a/test/Microsoft.AspNetCore.Http.Tests/QueryFeatureTests.cs +++ b/test/Microsoft.AspNetCore.Http.Tests/Features/QueryFeatureTests.cs @@ -3,7 +3,7 @@ using Xunit; -namespace Microsoft.AspNetCore.Http.Features.Internal +namespace Microsoft.AspNetCore.Http.Features { public class QueryFeatureTests { diff --git a/test/Microsoft.AspNetCore.Http.Tests/HeaderDictionaryTests.cs b/test/Microsoft.AspNetCore.Http.Tests/HeaderDictionaryTests.cs index 3d82b07a..a1fac365 100644 --- a/test/Microsoft.AspNetCore.Http.Tests/HeaderDictionaryTests.cs +++ b/test/Microsoft.AspNetCore.Http.Tests/HeaderDictionaryTests.cs @@ -6,7 +6,7 @@ using Microsoft.Extensions.Primitives; using Xunit; -namespace Microsoft.AspNetCore.Http.Internal +namespace Microsoft.AspNetCore.Http { public class HeaderDictionaryTests { diff --git a/test/Microsoft.AspNetCore.Http.Tests/HttpContextFactoryTests.cs b/test/Microsoft.AspNetCore.Http.Tests/HttpContextFactoryTests.cs index 29029c4a..dd476f81 100644 --- a/test/Microsoft.AspNetCore.Http.Tests/HttpContextFactoryTests.cs +++ b/test/Microsoft.AspNetCore.Http.Tests/HttpContextFactoryTests.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.ObjectPool; using Xunit; -namespace Microsoft.AspNetCore.Http.Internal +namespace Microsoft.AspNetCore.Http { public class HttpContextFactoryTests { diff --git a/test/Microsoft.AspNetCore.Http.Tests/ApplicationBuilderTests.cs b/test/Microsoft.AspNetCore.Http.Tests/Internal/ApplicationBuilderTests.cs similarity index 93% rename from test/Microsoft.AspNetCore.Http.Tests/ApplicationBuilderTests.cs rename to test/Microsoft.AspNetCore.Http.Tests/Internal/ApplicationBuilderTests.cs index 280e51bf..3a1a4b16 100644 --- a/test/Microsoft.AspNetCore.Http.Tests/ApplicationBuilderTests.cs +++ b/test/Microsoft.AspNetCore.Http.Tests/Internal/ApplicationBuilderTests.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Http.Internal; +using Microsoft.AspNetCore.Http; using Xunit; namespace Microsoft.AspNetCore.Builder.Internal diff --git a/test/Microsoft.AspNetCore.Http.Tests/BufferingHelperTests.cs b/test/Microsoft.AspNetCore.Http.Tests/Internal/BufferingHelperTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Http.Tests/BufferingHelperTests.cs rename to test/Microsoft.AspNetCore.Http.Tests/Internal/BufferingHelperTests.cs diff --git a/test/Microsoft.AspNetCore.Http.Tests/DefaultHttpRequestTests.cs b/test/Microsoft.AspNetCore.Http.Tests/Internal/DefaultHttpRequestTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Http.Tests/DefaultHttpRequestTests.cs rename to test/Microsoft.AspNetCore.Http.Tests/Internal/DefaultHttpRequestTests.cs diff --git a/test/Microsoft.AspNetCore.Http.Tests/DefaultHttpResponseTests.cs b/test/Microsoft.AspNetCore.Http.Tests/Internal/DefaultHttpResponseTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Http.Tests/DefaultHttpResponseTests.cs rename to test/Microsoft.AspNetCore.Http.Tests/Internal/DefaultHttpResponseTests.cs diff --git a/test/Microsoft.AspNetCore.Owin.Tests/OwinEnvironmentTests.cs b/test/Microsoft.AspNetCore.Owin.Tests/OwinEnvironmentTests.cs index 5c076b61..7cd6ef88 100644 --- a/test/Microsoft.AspNetCore.Owin.Tests/OwinEnvironmentTests.cs +++ b/test/Microsoft.AspNetCore.Owin.Tests/OwinEnvironmentTests.cs @@ -7,7 +7,6 @@ using System.Security.Claims; using System.Threading; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Internal; using Xunit; namespace Microsoft.AspNetCore.Owin diff --git a/test/Microsoft.AspNetCore.Owin.Tests/OwinExtensionTests.cs b/test/Microsoft.AspNetCore.Owin.Tests/OwinExtensionTests.cs index 66c62334..c4c51fba 100644 --- a/test/Microsoft.AspNetCore.Owin.Tests/OwinExtensionTests.cs +++ b/test/Microsoft.AspNetCore.Owin.Tests/OwinExtensionTests.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder.Internal; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Internal; using Microsoft.Extensions.DependencyInjection; using Xunit;