diff --git a/.editorconfig b/.editorconfig index 1fb8f09408a4..3151862d60e4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -246,6 +246,10 @@ file_header_template = Licensed to the .NET Foundation under one or more agreeme # IDE0161: Convert to file-scoped namespace dotnet_diagnostic.IDE0161.severity = warning +# IDE2000: Disallow multiple blank lines +dotnet_style_allow_multiple_blank_lines_experimental = false +dotnet_diagnostic.IDE2000.severity = warning + [**/{test,samples,perf}/**.{cs,vb}] # CA1018: Mark attributes with AttributeUsageAttribute dotnet_diagnostic.CA1018.severity = suggestion diff --git a/src/Analyzers/Analyzers/test/MinimalStartupTest.cs b/src/Analyzers/Analyzers/test/MinimalStartupTest.cs index 96db378371b7..01a35f57c9f8 100644 --- a/src/Analyzers/Analyzers/test/MinimalStartupTest.cs +++ b/src/Analyzers/Analyzers/test/MinimalStartupTest.cs @@ -481,8 +481,6 @@ protected Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expe return test.RunAsync(); } - - [Fact] public async Task StartupAnalyzer_AuthNoRouting() { diff --git a/src/Analyzers/Analyzers/test/StartupFactsTest.cs b/src/Analyzers/Analyzers/test/StartupFactsTest.cs index 53e643372bfd..4aaf706d1e77 100644 --- a/src/Analyzers/Analyzers/test/StartupFactsTest.cs +++ b/src/Analyzers/Analyzers/test/StartupFactsTest.cs @@ -105,7 +105,6 @@ internal void Configure(IApplicationBuilder app) [nameof(NotAStartupClass)] = NotAStartupClass, }; - [Theory] [InlineData(nameof(BasicStartup), "ConfigureServices")] [InlineData(nameof(EnvironmentStartup), "ConfigureDevelopmentServices")] diff --git a/src/Antiforgery/src/AntiforgeryServiceCollectionExtensions.cs b/src/Antiforgery/src/AntiforgeryServiceCollectionExtensions.cs index 66400535054d..a77b07209cda 100644 --- a/src/Antiforgery/src/AntiforgeryServiceCollectionExtensions.cs +++ b/src/Antiforgery/src/AntiforgeryServiceCollectionExtensions.cs @@ -39,7 +39,6 @@ public static IServiceCollection AddAntiforgery(this IServiceCollection services services.TryAddSingleton(); services.TryAddSingleton(); - services.TryAddSingleton>(serviceProvider => { var provider = serviceProvider.GetRequiredService(); diff --git a/src/Antiforgery/test/DefaultAntiforgeryTokenGeneratorTest.cs b/src/Antiforgery/test/DefaultAntiforgeryTokenGeneratorTest.cs index 5d13a819797d..55551c540825 100644 --- a/src/Antiforgery/test/DefaultAntiforgeryTokenGeneratorTest.cs +++ b/src/Antiforgery/test/DefaultAntiforgeryTokenGeneratorTest.cs @@ -261,7 +261,6 @@ public void IsCookieTokenValid_ValidToken_ReturnsTrue() Assert.True(isValid); } - [Fact] public void TryValidateTokenSet_CookieTokenMissing() { @@ -296,7 +295,6 @@ public void TryValidateTokenSet_FieldTokenMissing() claimUidExtractor: null, additionalDataProvider: null); - // Act & Assert string message; var ex = Assert.Throws( diff --git a/src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/AzureAdB2COptions.cs b/src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/AzureAdB2COptions.cs index 486fdfb0cbf2..a1c4bf84b54a 100644 --- a/src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/AzureAdB2COptions.cs +++ b/src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/AzureAdB2COptions.cs @@ -30,7 +30,6 @@ public class AzureADB2COptions /// public string JwtBearerSchemeName { get; internal set; } - /// /// Gets or sets the client Id. /// diff --git a/src/Caching/SqlServer/src/MonoSqlParameterCollectionExtensions.cs b/src/Caching/SqlServer/src/MonoSqlParameterCollectionExtensions.cs index 45b5b60c2341..96e896912ade 100644 --- a/src/Caching/SqlServer/src/MonoSqlParameterCollectionExtensions.cs +++ b/src/Caching/SqlServer/src/MonoSqlParameterCollectionExtensions.cs @@ -25,7 +25,6 @@ public static SqlParameterCollection AddExpiresAtTimeMono( return parameters.AddWithValue(Columns.Names.ExpiresAtTime, SqlDbType.DateTime, utcTime.UtcDateTime); } - public static SqlParameterCollection AddAbsoluteExpirationMono( this SqlParameterCollection parameters, DateTimeOffset? utcTime) diff --git a/src/Components/Components/src/BindConverter.cs b/src/Components/Components/src/BindConverter.cs index 55d53519dbce..d4d2125fcb6f 100644 --- a/src/Components/Components/src/BindConverter.cs +++ b/src/Components/Components/src/BindConverter.cs @@ -411,7 +411,6 @@ private static string FormatDateTimeValueCore(DateTime value, CultureInfo? cultu [SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Required to maintain compatibility")] public static string FormatValue(DateTimeOffset value, CultureInfo? culture = null) => FormatDateTimeOffsetValueCore(value, format: null, culture); - /// /// Formats the provided as a . /// diff --git a/src/Components/Components/src/ComponentBase.cs b/src/Components/Components/src/ComponentBase.cs index 1a4b2b983676..1c172a30f54c 100644 --- a/src/Components/Components/src/ComponentBase.cs +++ b/src/Components/Components/src/ComponentBase.cs @@ -188,7 +188,6 @@ void IComponent.Attach(RenderHandle renderHandle) _renderHandle = renderHandle; } - /// /// Sets parameters supplied by the component's parent in the render tree. /// diff --git a/src/Components/Components/src/Rendering/RenderTreeBuilder.cs b/src/Components/Components/src/Rendering/RenderTreeBuilder.cs index 7b639080f9df..c73277b706a5 100644 --- a/src/Components/Components/src/Rendering/RenderTreeBuilder.cs +++ b/src/Components/Components/src/Rendering/RenderTreeBuilder.cs @@ -170,7 +170,6 @@ public void AddAttribute(int sequence, string name) throw new InvalidOperationException($"Valueless attributes may only be added immediately after frames of type {RenderTreeFrameType.Element}"); } - _entries.AppendAttribute(sequence, name, BoxedTrue); } diff --git a/src/Components/Components/test/EventCallbackTest.cs b/src/Components/Components/test/EventCallbackTest.cs index 48090e0d0e40..faa6909d04ca 100644 --- a/src/Components/Components/test/EventCallbackTest.cs +++ b/src/Components/Components/test/EventCallbackTest.cs @@ -27,7 +27,6 @@ public async Task EventCallbackOfT_Default() await callback.InvokeAsync(); } - [Fact] public async Task EventCallback_NullReceiver() { @@ -38,7 +37,6 @@ public async Task EventCallback_NullReceiver() // Act await callback.InvokeAsync(); - // Assert Assert.Equal(1, runCount); } @@ -53,7 +51,6 @@ public async Task EventCallbackOfT_NullReceiver() // Act await callback.InvokeAsync(); - // Assert Assert.Equal(1, runCount); } @@ -70,7 +67,6 @@ public async Task EventCallback_Action_Null() // Act await callback.InvokeAsync(); - // Assert Assert.Equal(1, runCount); Assert.Equal(1, component.Count); @@ -88,7 +84,6 @@ public async Task EventCallback_Action_IgnoresArg() // Act await callback.InvokeAsync(new EventArgs()); - // Assert Assert.Equal(1, runCount); Assert.Equal(1, component.Count); @@ -107,7 +102,6 @@ public async Task EventCallback_ActionT_Null() // Act await callback.InvokeAsync(); - // Assert Assert.Null(arg); Assert.Equal(1, runCount); @@ -127,7 +121,6 @@ public async Task EventCallback_ActionT_Arg() // Act await callback.InvokeAsync(new EventArgs()); - // Assert Assert.NotNull(arg); Assert.Equal(1, runCount); @@ -147,7 +140,6 @@ public async Task EventCallback_ActionT_Arg_ValueType() // Act await callback.InvokeAsync(17); - // Assert Assert.Equal(17, arg); Assert.Equal(1, runCount); @@ -183,7 +175,6 @@ public async Task EventCallback_FuncTask_Null() // Act await callback.InvokeAsync(); - // Assert Assert.Equal(1, runCount); Assert.Equal(1, component.Count); @@ -201,7 +192,6 @@ public async Task EventCallback_FuncTask_IgnoresArg() // Act await callback.InvokeAsync(new EventArgs()); - // Assert Assert.Equal(1, runCount); Assert.Equal(1, component.Count); @@ -220,7 +210,6 @@ public async Task EventCallback_FuncTTask_Null() // Act await callback.InvokeAsync(); - // Assert Assert.Null(arg); Assert.Equal(1, runCount); @@ -240,7 +229,6 @@ public async Task EventCallback_FuncTTask_Arg() // Act await callback.InvokeAsync(new EventArgs()); - // Assert Assert.NotNull(arg); Assert.Equal(1, runCount); @@ -260,7 +248,6 @@ public async Task EventCallback_FuncTTask_Arg_ValueType() // Act await callback.InvokeAsync(17); - // Assert Assert.Equal(17, arg); Assert.Equal(1, runCount); @@ -296,7 +283,6 @@ public async Task EventCallbackOfT_Action_Null() // Act await callback.InvokeAsync(); - // Assert Assert.Equal(1, runCount); Assert.Equal(1, component.Count); @@ -314,7 +300,6 @@ public async Task EventCallbackOfT_Action_IgnoresArg() // Act await callback.InvokeAsync(new EventArgs()); - // Assert Assert.Equal(1, runCount); Assert.Equal(1, component.Count); @@ -333,7 +318,6 @@ public async Task EventCallbackOfT_ActionT_Null() // Act await callback.InvokeAsync(); - // Assert Assert.Null(arg); Assert.Equal(1, runCount); @@ -353,7 +337,6 @@ public async Task EventCallbackOfT_ActionT_Arg() // Act await callback.InvokeAsync(new EventArgs()); - // Assert Assert.NotNull(arg); Assert.Equal(1, runCount); @@ -372,7 +355,6 @@ public async Task EventCallbackOfT_FuncTask_Null() // Act await callback.InvokeAsync(); - // Assert Assert.Equal(1, runCount); Assert.Equal(1, component.Count); @@ -390,7 +372,6 @@ public async Task EventCallbackOfT_FuncTask_IgnoresArg() // Act await callback.InvokeAsync(new EventArgs()); - // Assert Assert.Equal(1, runCount); Assert.Equal(1, component.Count); @@ -409,7 +390,6 @@ public async Task EventCallbackOfT_FuncTTask_Null() // Act await callback.InvokeAsync(); - // Assert Assert.Null(arg); Assert.Equal(1, runCount); @@ -429,7 +409,6 @@ public async Task EventCallbackOfT_FuncTTask_Arg() // Act await callback.InvokeAsync(new EventArgs()); - // Assert Assert.NotNull(arg); Assert.Equal(1, runCount); diff --git a/src/Components/Components/test/ParameterViewTest.cs b/src/Components/Components/test/ParameterViewTest.cs index 4e2be474d3bf..584609b0dc09 100644 --- a/src/Components/Components/test/ParameterViewTest.cs +++ b/src/Components/Components/test/ParameterViewTest.cs @@ -14,8 +14,8 @@ public void CanInitializeUsingComponentWithNoDescendants() // Arrange var frames = new[] { - RenderTreeFrame.ChildComponent(0, typeof(FakeComponent)).WithComponentSubtreeLength(1) - }; + RenderTreeFrame.ChildComponent(0, typeof(FakeComponent)).WithComponentSubtreeLength(1) + }; var parameters = new ParameterView(ParameterViewLifetime.Unbound, frames, 0); // Assert @@ -28,8 +28,8 @@ public void CanInitializeUsingElementWithNoDescendants() // Arrange var frames = new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(1) - }; + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(1) + }; var parameters = new ParameterView(ParameterViewLifetime.Unbound, frames, 0); // Assert @@ -44,14 +44,14 @@ public void EnumerationStopsAtEndOfOwnerDescendants() var attribute2Value = new object(); var frames = new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(3), - RenderTreeFrame.Attribute(1, "attribute 1", attribute1Value), - RenderTreeFrame.Attribute(2, "attribute 2", attribute2Value), - // Although RenderTreeBuilder doesn't let you add orphaned attributes like this, - // still want to verify that parameters doesn't attempt to read past the - // end of the owner's descendants - RenderTreeFrame.Attribute(3, "orphaned attribute", "value") - }; + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(3), + RenderTreeFrame.Attribute(1, "attribute 1", attribute1Value), + RenderTreeFrame.Attribute(2, "attribute 2", attribute2Value), + // Although RenderTreeBuilder doesn't let you add orphaned attributes like this, + // still want to verify that parameters doesn't attempt to read past the + // end of the owner's descendants + RenderTreeFrame.Attribute(3, "orphaned attribute", "value") + }; var parameters = new ParameterView(ParameterViewLifetime.Unbound, frames, 0); // Assert @@ -68,12 +68,12 @@ public void EnumerationStopsAtEndOfOwnerAttributes() var attribute2Value = new object(); var frames = new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(3), - RenderTreeFrame.Attribute(1, "attribute 1", attribute1Value), - RenderTreeFrame.Attribute(2, "attribute 2", attribute2Value), - RenderTreeFrame.Element(3, "child element").WithElementSubtreeLength(2), - RenderTreeFrame.Attribute(4, "child attribute", "some value") - }; + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(3), + RenderTreeFrame.Attribute(1, "attribute 1", attribute1Value), + RenderTreeFrame.Attribute(2, "attribute 2", attribute2Value), + RenderTreeFrame.Element(3, "child element").WithElementSubtreeLength(2), + RenderTreeFrame.Attribute(4, "child attribute", "some value") + }; var parameters = new ParameterView(ParameterViewLifetime.Unbound, frames, 0); // Assert @@ -91,13 +91,13 @@ public void EnumerationIncludesCascadingParameters() var attribute3Value = new object(); var parameters = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), - RenderTreeFrame.Attribute(1, "attribute 1", attribute1Value) - }, 0).WithCascadingParameters(new List - { - new CascadingParameterState("attribute 2", new TestCascadingValue(attribute2Value)), - new CascadingParameterState("attribute 3", new TestCascadingValue(attribute3Value)), - }); + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), + RenderTreeFrame.Attribute(1, "attribute 1", attribute1Value) + }, 0).WithCascadingParameters(new List + { + new CascadingParameterState("attribute 2", new TestCascadingValue(attribute2Value)), + new CascadingParameterState("attribute 3", new TestCascadingValue(attribute3Value)), + }); // Assert Assert.Collection(ToEnumerable(parameters), @@ -112,9 +112,9 @@ public void CanTryGetNonExistingValue() // Arrange var parameters = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), - RenderTreeFrame.Attribute(1, "some other entry", new object()) - }, 0); + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), + RenderTreeFrame.Attribute(1, "some other entry", new object()) + }, 0); // Act var didFind = parameters.TryGetValue("nonexisting entry", out var value); @@ -130,9 +130,9 @@ public void CanTryGetExistingValueWithCorrectType() // Arrange var parameters = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), - RenderTreeFrame.Attribute(1, "my entry", "hello") - }, 0); + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), + RenderTreeFrame.Attribute(1, "my entry", "hello") + }, 0); // Act var didFind = parameters.TryGetValue("my entry", out var value); @@ -149,10 +149,10 @@ public void CanGetValueOrDefault_WithExistingValue() var myEntryValue = new object(); var parameters = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), - RenderTreeFrame.Attribute(1, "my entry", myEntryValue), - RenderTreeFrame.Attribute(1, "my other entry", new object()) - }, 0); + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), + RenderTreeFrame.Attribute(1, "my entry", myEntryValue), + RenderTreeFrame.Attribute(1, "my other entry", new object()) + }, 0); // Act var result = parameters.GetValueOrDefault("my entry"); @@ -168,10 +168,10 @@ public void CanGetValueOrDefault_WithMultipleMatchingValues() var myEntryValue = new object(); var parameters = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(3), - RenderTreeFrame.Attribute(1, "my entry", myEntryValue), - RenderTreeFrame.Attribute(1, "my entry", new object()), - }, 0); + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(3), + RenderTreeFrame.Attribute(1, "my entry", myEntryValue), + RenderTreeFrame.Attribute(1, "my entry", new object()), + }, 0); // Act var result = parameters.GetValueOrDefault("my entry"); @@ -186,12 +186,12 @@ public void CanGetValueOrDefault_WithNonExistingValue() // Arrange var parameters = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), - RenderTreeFrame.Attribute(1, "some other entry", new object()) - }, 0).WithCascadingParameters(new List - { - new CascadingParameterState("another entry", new TestCascadingValue(null)) - }); + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), + RenderTreeFrame.Attribute(1, "some other entry", new object()) + }, 0).WithCascadingParameters(new List + { + new CascadingParameterState("another entry", new TestCascadingValue(null)) + }); // Act var result = parameters.GetValueOrDefault("nonexisting entry"); @@ -207,9 +207,9 @@ public void CanGetValueOrDefault_WithNonExistingValueAndExplicitDefault() var explicitDefaultValue = new DateTime(2018, 3, 20); var parameters = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), - RenderTreeFrame.Attribute(1, "some other entry", new object()) - }, 0); + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), + RenderTreeFrame.Attribute(1, "some other entry", new object()) + }, 0); // Act var result = parameters.GetValueOrDefault("nonexisting entry", explicitDefaultValue); @@ -224,9 +224,9 @@ public void ThrowsIfTryGetExistingValueWithIncorrectType() // Arrange var parameters = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), - RenderTreeFrame.Attribute(1, "my entry", "hello") - }, 0); + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), + RenderTreeFrame.Attribute(1, "my entry", "hello") + }, 0); // Act/Assert Assert.Throws(() => @@ -265,7 +265,6 @@ public void FromDictionary_RoundTrips() Assert.Equal(dictionary, collection.ToDictionary()); } - [Fact] public void CanConvertToReadOnlyDictionary() { @@ -273,10 +272,10 @@ public void CanConvertToReadOnlyDictionary() var entry2Value = new object(); var parameters = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(3), - RenderTreeFrame.Attribute(0, "entry 1", "value 1"), - RenderTreeFrame.Attribute(0, "entry 2", entry2Value), - }, 0); + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(3), + RenderTreeFrame.Attribute(0, "entry 1", "value 1"), + RenderTreeFrame.Attribute(0, "entry 2", entry2Value), + }, 0); // Act IReadOnlyDictionary dict = parameters.ToDictionary(); @@ -302,14 +301,14 @@ public void CanGetValueOrDefault_WithMatchingCascadingParameter() var myEntryValue = new object(); var parameters = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), - RenderTreeFrame.Attribute(1, "unrelated value", new object()) - }, 0).WithCascadingParameters(new List - { - new CascadingParameterState("unrelated value 2", new TestCascadingValue(null)), - new CascadingParameterState("my entry", new TestCascadingValue(myEntryValue)), - new CascadingParameterState("unrelated value 3", new TestCascadingValue(null)), - }); + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), + RenderTreeFrame.Attribute(1, "unrelated value", new object()) + }, 0).WithCascadingParameters(new List + { + new CascadingParameterState("unrelated value 2", new TestCascadingValue(null)), + new CascadingParameterState("my entry", new TestCascadingValue(myEntryValue)), + new CascadingParameterState("unrelated value 3", new TestCascadingValue(null)), + }); // Act var result = parameters.GetValueOrDefault("my entry"); @@ -326,8 +325,8 @@ public void CannotReadAfterLifetimeExpiry() var lifetime = new ParameterViewLifetime(builder); var frames = new[] { - RenderTreeFrame.ChildComponent(0, typeof(FakeComponent)).WithComponentSubtreeLength(1) - }; + RenderTreeFrame.ChildComponent(0, typeof(FakeComponent)).WithComponentSubtreeLength(1) + }; var parameterView = new ParameterView(lifetime, frames, 0); // Act @@ -364,10 +363,9 @@ public void Clone_ParameterViewSingleParameter() var attribute1Value = new object(); var initial = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), - RenderTreeFrame.Attribute(1, "attribute 1", attribute1Value), - }, 0); - + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(2), + RenderTreeFrame.Attribute(1, "attribute 1", attribute1Value), + }, 0); // Act var cloned = initial.Clone(); @@ -387,12 +385,11 @@ public void Clone_ParameterPreservesOrder() var attribute3Value = new object(); var initial = new ParameterView(ParameterViewLifetime.Unbound, new[] { - RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(4), - RenderTreeFrame.Attribute(1, "attribute 1", attribute1Value), - RenderTreeFrame.Attribute(1, "attribute 2", attribute2Value), - RenderTreeFrame.Attribute(1, "attribute 3", attribute3Value), - }, 0); - + RenderTreeFrame.Element(0, "some element").WithElementSubtreeLength(4), + RenderTreeFrame.Attribute(1, "attribute 1", attribute1Value), + RenderTreeFrame.Attribute(1, "attribute 2", attribute2Value), + RenderTreeFrame.Attribute(1, "attribute 3", attribute3Value), + }, 0); // Act var cloned = initial.Clone(); diff --git a/src/Components/Components/test/Rendering/RenderTreeBuilderTest.cs b/src/Components/Components/test/Rendering/RenderTreeBuilderTest.cs index dd44d8666352..e314cef29c02 100644 --- a/src/Components/Components/test/Rendering/RenderTreeBuilderTest.cs +++ b/src/Components/Components/test/Rendering/RenderTreeBuilderTest.cs @@ -1660,7 +1660,6 @@ public void ProcessDuplicateAttributes_DoesNotRemoveDuplicatesWithoutAddMultiple f => AssertFrame.Attribute(f, "id", "bye")); } - [Fact] public void ProcessDuplicateAttributes_StopsAtFirstNonAttributeFrame_Capture() { diff --git a/src/Components/Components/test/Rendering/RendererSynchronizationContextTest.cs b/src/Components/Components/test/Rendering/RendererSynchronizationContextTest.cs index 1ce2a57e33b7..ff371119c891 100644 --- a/src/Components/Components/test/Rendering/RendererSynchronizationContextTest.cs +++ b/src/Components/Components/test/Rendering/RendererSynchronizationContextTest.cs @@ -250,7 +250,6 @@ public async Task Post_BackgroundWorkItem_CanProcessMoreItemsInline() Assert.Same(Thread.CurrentThread, capturedThread); }, null); - // Assert e4.Set(); await task2; diff --git a/src/Components/Components/test/RouteViewTest.cs b/src/Components/Components/test/RouteViewTest.cs index 96d0bd877e4c..35234abe2e83 100644 --- a/src/Components/Components/test/RouteViewTest.cs +++ b/src/Components/Components/test/RouteViewTest.cs @@ -28,7 +28,6 @@ public void ThrowsIfNoRouteDataSupplied() _ = _routeViewComponent.SetParametersAsync(ParameterView.Empty); }); - Assert.Equal($"The {nameof(RouteView)} component requires a non-null value for the parameter {nameof(RouteView.RouteData)}.", ex.Message); } diff --git a/src/Components/Components/test/Routing/RouteTableFactoryTests.cs b/src/Components/Components/test/Routing/RouteTableFactoryTests.cs index cd9bef2f8dc7..f75ec0417a36 100644 --- a/src/Components/Components/test/Routing/RouteTableFactoryTests.cs +++ b/src/Components/Components/test/Routing/RouteTableFactoryTests.cs @@ -269,7 +269,6 @@ public void CanMatchTemplateWithMultipleParameters() Assert.Equal(expectedParameters, context.Parameters); } - [Fact] public void CanMatchTemplateWithMultipleParametersAndCatchAllParameter() { @@ -419,7 +418,6 @@ public void CanMatchCatchAllParametersWithConstraints(string template, string pa Assert.Equal("1/2/3/4/5", values); } - [Fact] public void CatchAllEmpty() { diff --git a/src/Components/Server/test/Circuits/RemoteRendererTest.cs b/src/Components/Server/test/Circuits/RemoteRendererTest.cs index 940cd0b45554..bac53141338d 100644 --- a/src/Components/Server/test/Circuits/RemoteRendererTest.cs +++ b/src/Components/Server/test/Circuits/RemoteRendererTest.cs @@ -91,7 +91,6 @@ public async Task NoNewBatchesAreCreated_WhenThereAreNoPendingRenderRequestsFrom Assert.Equal(9, renderer._unacknowledgedRenderBatches.Count); } - [Fact] public async Task ProducesNewBatch_WhenABatchGetsAcknowledged() { diff --git a/src/Components/Server/test/Circuits/ServerComponentDeserializerTest.cs b/src/Components/Server/test/Circuits/ServerComponentDeserializerTest.cs index cc68230dd90d..d07f0b74ed2b 100644 --- a/src/Components/Server/test/Circuits/ServerComponentDeserializerTest.cs +++ b/src/Components/Server/test/Circuits/ServerComponentDeserializerTest.cs @@ -116,7 +116,6 @@ public void CanParseMultipleMarkersWithParameters() Assert.Contains("First", firstParameters.Keys); Assert.Equal("Value", firstParameters["First"]); - var secondDescriptor = descriptors[1]; Assert.Equal(typeof(TestComponent).FullName, secondDescriptor.ComponentType.FullName); Assert.Equal(1, secondDescriptor.Sequence); @@ -147,7 +146,6 @@ public void CanParseMultipleMarkersWithAndWithoutParameters() Assert.Contains("First", firstParameters.Keys); Assert.Equal("Value", firstParameters["First"]); - var secondDescriptor = descriptors[1]; Assert.Equal(typeof(TestComponent).FullName, secondDescriptor.ComponentType.FullName); Assert.Equal(1, secondDescriptor.Sequence); diff --git a/src/Components/Server/test/ProtectedBrowserStorageTest.cs b/src/Components/Server/test/ProtectedBrowserStorageTest.cs index e43e685b5c33..89da1b351874 100644 --- a/src/Components/Server/test/ProtectedBrowserStorageTest.cs +++ b/src/Components/Server/test/ProtectedBrowserStorageTest.cs @@ -66,7 +66,6 @@ public void SetAsync_ProtectsAndInvokesJS_CustomPurpose() TestDataProtectionProvider.Unprotect(customPurpose, (string)arg))); } - [Fact] public void SetAsync_ProtectsAndInvokesJS_NullValue() { @@ -145,7 +144,6 @@ public async Task GetAsync_InvokesJSAndUnprotects_ValidData_CustomPurpose() Assert.Collection(invocation.Args, arg => Assert.Equal(keyName, arg)); } - [Fact] public async Task GetAsync_InvokesJSAndUnprotects_NoValue() { @@ -216,7 +214,6 @@ public async Task GetAsync_InvokesJSAndUnprotects_InvalidProtection_Base64Encode async () => await protectedBrowserStorage.GetAsync("testKey")); } - [Fact] public async Task GetValueOrDefaultAsync_InvokesJSAndUnprotects_WrongPurpose() { @@ -299,7 +296,6 @@ class TestDataProtectionProvider : IDataProtectionProvider { public List ProtectorsCreated { get; } = new List(); - public static string Protect(string purpose, string plaintext) => new TestDataProtector(purpose).Protect(plaintext); diff --git a/src/Components/Web/src/WebEventData/ChangeEventArgsReader.cs b/src/Components/Web/src/WebEventData/ChangeEventArgsReader.cs index 57c457ef9185..0af163d134e3 100644 --- a/src/Components/Web/src/WebEventData/ChangeEventArgsReader.cs +++ b/src/Components/Web/src/WebEventData/ChangeEventArgsReader.cs @@ -68,6 +68,3 @@ internal static ChangeEventArgs Read(JsonElement jsonElement) return result; } } - - - diff --git a/src/Components/Web/src/WebEventData/WheelEventArgsReader.cs b/src/Components/Web/src/WebEventData/WheelEventArgsReader.cs index 39c7f2215d6e..80814338716a 100644 --- a/src/Components/Web/src/WebEventData/WheelEventArgsReader.cs +++ b/src/Components/Web/src/WebEventData/WheelEventArgsReader.cs @@ -14,7 +14,6 @@ internal static class WheelEventArgsReader private static readonly JsonEncodedText DeltaZ = JsonEncodedText.Encode("deltaZ"); private static readonly JsonEncodedText DeltaMode = JsonEncodedText.Encode("deltaMode"); - internal static WheelEventArgs Read(JsonElement jsonElement) { var eventArgs = new WheelEventArgs(); diff --git a/src/Components/Web/test/Forms/InputBaseTest.cs b/src/Components/Web/test/Forms/InputBaseTest.cs index 0a15e3daf332..6d0123686fe3 100644 --- a/src/Components/Web/test/Forms/InputBaseTest.cs +++ b/src/Components/Web/test/Forms/InputBaseTest.cs @@ -420,7 +420,6 @@ public async Task AriaAttributeIsRenderedWhenTheValidationStateIsInvalidOnFirstR var rootComponentId = renderer.AssignRootComponentId(rootComponent); await renderer.RenderRootComponentAsync(rootComponentId); - // Initally, it rendered one batch and is valid var batch1 = renderer.Batches.Single(); var componentFrame1 = batch1.GetComponentFrames>().Single(); diff --git a/src/Components/WebAssembly/DevServer/src/Program.cs b/src/Components/WebAssembly/DevServer/src/Program.cs index 74f5c835c7df..ea2049f0c68c 100644 --- a/src/Components/WebAssembly/DevServer/src/Program.cs +++ b/src/Components/WebAssembly/DevServer/src/Program.cs @@ -5,7 +5,6 @@ using Microsoft.Extensions.Hosting; using DevServerProgram = Microsoft.AspNetCore.Components.WebAssembly.DevServer.Server.Program; - namespace Microsoft.AspNetCore.Components.WebAssembly.DevServer; internal class Program diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/AuthorizationMessageHandler.cs b/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/AuthorizationMessageHandler.cs index c598943c2663..2a7d35859143 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/AuthorizationMessageHandler.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Services/AuthorizationMessageHandler.cs @@ -126,7 +126,6 @@ public AuthorizationMessageHandler ConfigureHandler( return this; } - void IDisposable.Dispose() { if (_provider is AuthenticationStateProvider authStateProvider) diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/test/RemoteAuthenticatorCoreTests.cs b/src/Components/WebAssembly/WebAssembly.Authentication/test/RemoteAuthenticatorCoreTests.cs index c28e498c13fe..46fa7e2106fd 100644 --- a/src/Components/WebAssembly/WebAssembly.Authentication/test/RemoteAuthenticatorCoreTests.cs +++ b/src/Components/WebAssembly/WebAssembly.Authentication/test/RemoteAuthenticatorCoreTests.cs @@ -380,7 +380,6 @@ public async Task AuthenticationManager_LogoutCallback_ThrowsOnRedirectResult() Status = RemoteAuthenticationStatus.Redirect, }); - await Assert.ThrowsAsync( async () => await renderer.Dispatcher.InvokeAsync(async () => { @@ -559,7 +558,6 @@ public async Task AuthenticationManager_DoesNotThrowExceptionOnDisplaysUI_WhenPa // Act Task result = await renderer.Dispatcher.InvokeAsync(() => authenticator.SetParametersAsync(parameters)); - // Assert Assert.Null(result.Exception); } @@ -604,7 +602,6 @@ public async Task AuthenticationManager_DisplaysRightUI_WhenPathsAreMissing(UIVa validator.SetupFakeRender(authenticator); Task result = await renderer.Dispatcher.InvokeAsync(() => authenticator.SetParametersAsync(parameters)); - // Assert Assert.True(validator.WasCalled); Assert.Equal(methodName, validator.OriginalRender.Method.Name); diff --git a/src/Components/WebAssembly/WebAssembly/test/Hosting/RootComponentMappingTest.cs b/src/Components/WebAssembly/WebAssembly/test/Hosting/RootComponentMappingTest.cs index bc91e1d588f4..ef7d4a843382 100644 --- a/src/Components/WebAssembly/WebAssembly/test/Hosting/RootComponentMappingTest.cs +++ b/src/Components/WebAssembly/WebAssembly/test/Hosting/RootComponentMappingTest.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Text; using Microsoft.AspNetCore.Components.Routing; using Microsoft.AspNetCore.Testing; diff --git a/src/Components/WebAssembly/WebAssembly/test/Hosting/WebAssemblyHostBuilderTest.cs b/src/Components/WebAssembly/WebAssembly/test/Hosting/WebAssemblyHostBuilderTest.cs index d68734a0c15a..b6a6e62c4f3b 100644 --- a/src/Components/WebAssembly/WebAssembly/test/Hosting/WebAssemblyHostBuilderTest.cs +++ b/src/Components/WebAssembly/WebAssembly/test/Hosting/WebAssemblyHostBuilderTest.cs @@ -157,7 +157,6 @@ private class TestServiceThatTakesStringBuilder public TestServiceThatTakesStringBuilder(StringBuilder builder) { } } - private class MyFakeDIBuilderThing { public MyFakeDIBuilderThing(IServiceCollection serviceCollection) diff --git a/src/Components/WebView/WebView/test/Infrastructure/TestDocument.cs b/src/Components/WebView/WebView/test/Infrastructure/TestDocument.cs index 3adbba849511..aec199263c1a 100644 --- a/src/Components/WebView/WebView/test/Infrastructure/TestDocument.cs +++ b/src/Components/WebView/WebView/test/Infrastructure/TestDocument.cs @@ -147,7 +147,6 @@ private void ApplyEdits(RenderBatch batch, ContainerNode parent, int childIndex, break; } - case RenderTreeEditType.UpdateMarkup: { var frame = batch.ReferenceFrames.Array[edit.ReferenceFrameIndex]; diff --git a/src/Components/benchmarkapps/Wasm.Performance/Driver/Program.cs b/src/Components/benchmarkapps/Wasm.Performance/Driver/Program.cs index 69f305c92d52..044341971c97 100644 --- a/src/Components/benchmarkapps/Wasm.Performance/Driver/Program.cs +++ b/src/Components/benchmarkapps/Wasm.Performance/Driver/Program.cs @@ -112,7 +112,6 @@ private static void FormatAsBenchmarksOutput(BenchmarkResult benchmarkResult, bo // Sample of the the format: https://github.com/aspnet/Benchmarks/blob/e55f9e0312a7dd019d1268c1a547d1863f0c7237/src/Benchmarks/Program.cs#L51-L67 var output = new BenchmarkOutput(); - if (benchmarkResult.DownloadSize != null) { output.Metadata.Add(new BenchmarkMetadata diff --git a/src/Components/test/E2ETest/Tests/EventTest.cs b/src/Components/test/E2ETest/Tests/EventTest.cs index 92455b5725e6..91bd0ccd6ede 100644 --- a/src/Components/test/E2ETest/Tests/EventTest.cs +++ b/src/Components/test/E2ETest/Tests/EventTest.cs @@ -124,7 +124,6 @@ public void MouseDownAndMouseUp_CanTrigger() Browser.Equal("mousedown,mouseup,", () => output.Text); } - [Fact] public void Toggle_CanTrigger() { diff --git a/src/Components/test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs b/src/Components/test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs index e4aa187e278b..32cea07cfc38 100644 --- a/src/Components/test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs +++ b/src/Components/test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs @@ -125,7 +125,6 @@ public void CanShareUserRolesBetweenClientAndServer() Browser.Exists(By.Id("admin-success")); } - private void ClickAndNavigate(By link, string page) { Browser.Exists(link).Click(); diff --git a/src/Components/test/E2ETest/Tests/WebAssemblyLazyLoadTest.cs b/src/Components/test/E2ETest/Tests/WebAssemblyLazyLoadTest.cs index 688037c3a912..13affeeeceb5 100644 --- a/src/Components/test/E2ETest/Tests/WebAssemblyLazyLoadTest.cs +++ b/src/Components/test/E2ETest/Tests/WebAssemblyLazyLoadTest.cs @@ -116,7 +116,6 @@ public void ThrowsErrorForUnavailableAssemblies() var errorUiElem = Browser.Exists(By.Id("blazor-error-ui"), TimeSpan.FromSeconds(10)); Assert.NotNull(errorUiElem); - AssertLogContainsCriticalMessages("DoesNotExist.dll must be marked with 'BlazorWebAssemblyLazyLoad' item group in your project file to allow lazy-loading."); } diff --git a/src/Configuration.KeyPerFile/test/ConfigurationProviderTestBase.cs b/src/Configuration.KeyPerFile/test/ConfigurationProviderTestBase.cs index 0e5d0ce50ce5..6a95aab901e9 100644 --- a/src/Configuration.KeyPerFile/test/ConfigurationProviderTestBase.cs +++ b/src/Configuration.KeyPerFile/test/ConfigurationProviderTestBase.cs @@ -517,7 +517,6 @@ protected class TestSection } }; - public static TestSection MissingSection4Config { get; } = new TestSection { diff --git a/src/DataProtection/DataProtection/test/ActivatorTests.cs b/src/DataProtection/DataProtection/test/ActivatorTests.cs index 4b7273d2af01..a605b00127f9 100644 --- a/src/DataProtection/DataProtection/test/ActivatorTests.cs +++ b/src/DataProtection/DataProtection/test/ActivatorTests.cs @@ -52,7 +52,6 @@ public void CreateInstance_WithoutServiceProvider_PrefersParameterlessCtor() Assert.Null(retVal3.Services); } - [Fact] public void CreateInstance_TypeDoesNotImplementInterface_ThrowsInvalidCast() { diff --git a/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/AuthenticatedEncryptorDescriptorDeserializerTests.cs b/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/AuthenticatedEncryptorDescriptorDeserializerTests.cs index 8d2459d177b7..b47915e51e0d 100644 --- a/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/AuthenticatedEncryptorDescriptorDeserializerTests.cs +++ b/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/AuthenticatedEncryptorDescriptorDeserializerTests.cs @@ -52,7 +52,6 @@ private static IAuthenticatedEncryptor CreateEncryptorInstanceFromDescriptor(Aut descriptor, new[] { encryptorFactory }); - return key.CreateEncryptor(); } } diff --git a/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/AuthenticatedEncryptorDescriptorTests.cs b/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/AuthenticatedEncryptorDescriptorTests.cs index 9527bb8a16f3..325c18594651 100644 --- a/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/AuthenticatedEncryptorDescriptorTests.cs +++ b/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/AuthenticatedEncryptorDescriptorTests.cs @@ -207,7 +207,6 @@ private static IAuthenticatedEncryptor CreateEncryptorInstanceFromDescriptor(Aut descriptor, new[] { encryptorFactory }); - return key.CreateEncryptor(); } } diff --git a/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/CngCbcAuthenticatedEncryptorDescriptorDeserializerTests.cs b/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/CngCbcAuthenticatedEncryptorDescriptorDeserializerTests.cs index 4e55a33ba0ee..46067b5b3bb2 100644 --- a/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/CngCbcAuthenticatedEncryptorDescriptorDeserializerTests.cs +++ b/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/CngCbcAuthenticatedEncryptorDescriptorDeserializerTests.cs @@ -59,7 +59,6 @@ private static IAuthenticatedEncryptor CreateEncryptorInstanceFromDescriptor(Cng descriptor, new[] { encryptorFactory }); - return key.CreateEncryptor(); } } diff --git a/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/CngGcmAuthenticatedEncryptorDescriptorDeserializerTests.cs b/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/CngGcmAuthenticatedEncryptorDescriptorDeserializerTests.cs index 5c6d146b78f9..a79f5a1f15fc 100644 --- a/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/CngGcmAuthenticatedEncryptorDescriptorDeserializerTests.cs +++ b/src/DataProtection/DataProtection/test/AuthenticatedEncryption/ConfigurationModel/CngGcmAuthenticatedEncryptorDescriptorDeserializerTests.cs @@ -56,7 +56,6 @@ private static IAuthenticatedEncryptor CreateEncryptorInstanceFromDescriptor(Cng descriptor: descriptor, encryptorFactories: new[] { encryptorFactory }); - return key.CreateEncryptor(); } } diff --git a/src/DataProtection/DataProtection/test/KeyManagement/CacheableKeyRingTests.cs b/src/DataProtection/DataProtection/test/KeyManagement/CacheableKeyRingTests.cs index f422e1af046f..54fdde218cfc 100644 --- a/src/DataProtection/DataProtection/test/KeyManagement/CacheableKeyRingTests.cs +++ b/src/DataProtection/DataProtection/test/KeyManagement/CacheableKeyRingTests.cs @@ -43,7 +43,6 @@ public void IsValid_Expired_ReturnsFalse() Assert.False(CacheableKeyRing.IsValid(cacheableKeyRing, now.AddHours(1).UtcDateTime)); } - [Fact] public void KeyRing_Prop() { diff --git a/src/DataProtection/DataProtection/test/KeyManagement/KeyRingTests.cs b/src/DataProtection/DataProtection/test/KeyManagement/KeyRingTests.cs index fa878c99188c..4a47a8278029 100644 --- a/src/DataProtection/DataProtection/test/KeyManagement/KeyRingTests.cs +++ b/src/DataProtection/DataProtection/test/KeyManagement/KeyRingTests.cs @@ -69,7 +69,6 @@ public void GetAuthenticatedEncryptorByKeyId_DefersInstantiation_AndReturnsRevoc var key1 = new MyKey(expectedEncryptorInstance: expectedEncryptorInstance1, isRevoked: true); var key2 = new MyKey(expectedEncryptorInstance: expectedEncryptorInstance2); - // Act var keyRing = new KeyRing(key2, new[] { key1, key2 }); diff --git a/src/Features/JsonPatch/test/Adapters/AdapterFactoryTests.cs b/src/Features/JsonPatch/test/Adapters/AdapterFactoryTests.cs index 00f6942b0091..41b4afa5c4aa 100644 --- a/src/Features/JsonPatch/test/Adapters/AdapterFactoryTests.cs +++ b/src/Features/JsonPatch/test/Adapters/AdapterFactoryTests.cs @@ -44,7 +44,6 @@ public void GetDictionaryAdapterForDictionaryObjects() private class PocoModel { } - [Fact] public void GetPocoAdapterForGenericObjects() { @@ -58,8 +57,6 @@ public void GetPocoAdapterForGenericObjects() Assert.Equal(typeof(PocoAdapter), adapter.GetType()); } - - [Fact] public void GetDynamicAdapterForGenericObjects() { diff --git a/src/Features/JsonPatch/test/IntegrationTests/DynamicObjectIntegrationTest.cs b/src/Features/JsonPatch/test/IntegrationTests/DynamicObjectIntegrationTest.cs index 5c60a239622a..88830f7f7a9a 100644 --- a/src/Features/JsonPatch/test/IntegrationTests/DynamicObjectIntegrationTest.cs +++ b/src/Features/JsonPatch/test/IntegrationTests/DynamicObjectIntegrationTest.cs @@ -85,7 +85,6 @@ public void CopyProperties_InNestedDynamicObject() Assert.Equal("A", dynamicTestObject.NestedDynamicObject.AnotherStringProperty); } - [Fact] public void MoveToNonExistingProperty_InDynamicObject_ShouldAddNewProperty() { @@ -167,7 +166,6 @@ public void RemoveFromNestedObject_InDynamicObject_MixedCase_ThrowsPathNotFoundE Assert.Equal("The target location specified by path segment 'Simpleobject' was not found.", exception.Message); } - [Fact] public void ReplaceNestedTypedObject_InDynamicObject() { diff --git a/src/FileProviders/Manifest.MSBuildTask/test/GenerateEmbeddedResourcesManifestTest.cs b/src/FileProviders/Manifest.MSBuildTask/test/GenerateEmbeddedResourcesManifestTest.cs index 277177d6b072..62d1fb3e6127 100644 --- a/src/FileProviders/Manifest.MSBuildTask/test/GenerateEmbeddedResourcesManifestTest.cs +++ b/src/FileProviders/Manifest.MSBuildTask/test/GenerateEmbeddedResourcesManifestTest.cs @@ -320,7 +320,6 @@ private EmbeddedItem CreateEmbeddedItem(string manifestPath, string assemblyName AssemblyResourceName = assemblyName }; - public class TestGenerateEmbeddedResourcesManifest : GenerateEmbeddedResourcesManifest { diff --git a/src/HealthChecks/Abstractions/src/HealthCheckResult.cs b/src/HealthChecks/Abstractions/src/HealthCheckResult.cs index 6e6e3543729b..60fb9a968546 100644 --- a/src/HealthChecks/Abstractions/src/HealthCheckResult.cs +++ b/src/HealthChecks/Abstractions/src/HealthCheckResult.cs @@ -60,7 +60,6 @@ public static HealthCheckResult Healthy(string? description = null, IReadOnlyDic return new HealthCheckResult(status: HealthStatus.Healthy, description, exception: null, data); } - /// /// Creates a representing a degraded component. /// diff --git a/src/HealthChecks/Abstractions/src/HealthReportEntry.cs b/src/HealthChecks/Abstractions/src/HealthReportEntry.cs index 60967ba5c71f..3f79df0a7033 100644 --- a/src/HealthChecks/Abstractions/src/HealthReportEntry.cs +++ b/src/HealthChecks/Abstractions/src/HealthReportEntry.cs @@ -48,7 +48,6 @@ public HealthReportEntry(HealthStatus status, string? description, TimeSpan dura Tags = tags ?? Enumerable.Empty(); } - /// /// Gets additional key-value pairs describing the health of the component. /// diff --git a/src/HealthChecks/HealthChecks/src/DefaultHealthCheckService.cs b/src/HealthChecks/HealthChecks/src/DefaultHealthCheckService.cs index fa8d9897c455..2536b703bda3 100644 --- a/src/HealthChecks/HealthChecks/src/DefaultHealthCheckService.cs +++ b/src/HealthChecks/HealthChecks/src/DefaultHealthCheckService.cs @@ -58,7 +58,6 @@ public override async Task CheckHealthAsync( await Task.WhenAll(tasks).ConfigureAwait(false); - index = 0; var entries = new Dictionary(StringComparer.OrdinalIgnoreCase); foreach (var registration in registrations) diff --git a/src/HealthChecks/HealthChecks/src/HealthCheckPublisherHostedService.cs b/src/HealthChecks/HealthChecks/src/HealthCheckPublisherHostedService.cs index 75b6d5d66d75..677efe448fc1 100644 --- a/src/HealthChecks/HealthChecks/src/HealthCheckPublisherHostedService.cs +++ b/src/HealthChecks/HealthChecks/src/HealthCheckPublisherHostedService.cs @@ -95,7 +95,6 @@ public Task StopAsync(CancellationToken cancellationToken = default) _timer?.Dispose(); _timer = null; - return Task.CompletedTask; } diff --git a/src/Hosting/Abstractions/src/HostingEnvironmentExtensions.cs b/src/Hosting/Abstractions/src/HostingEnvironmentExtensions.cs index 527efc522762..ccdaced3171d 100644 --- a/src/Hosting/Abstractions/src/HostingEnvironmentExtensions.cs +++ b/src/Hosting/Abstractions/src/HostingEnvironmentExtensions.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - #pragma warning disable CS0618 // Type or member is obsolete namespace Microsoft.AspNetCore.Hosting; diff --git a/src/Hosting/Hosting/src/Internal/HostingApplication.cs b/src/Hosting/Hosting/src/Internal/HostingApplication.cs index 9b749bc3345b..7e8a348dc489 100644 --- a/src/Hosting/Hosting/src/Internal/HostingApplication.cs +++ b/src/Hosting/Hosting/src/Internal/HostingApplication.cs @@ -116,7 +116,6 @@ public void DisposeContext(Context context, Exception? exception) context.Reset(); } - internal class Context { public HttpContext? HttpContext { get; set; } diff --git a/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs b/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs index 4ff041b0b83e..7042fbb7ed79 100644 --- a/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs +++ b/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs @@ -57,7 +57,6 @@ public void BeginRequest(HttpContext httpContext, HostingApplication.Context con var diagnosticListenerActivityCreationEnabled = (diagnosticListenerEnabled && _diagnosticListener.IsEnabled(ActivityName, httpContext)); var loggingEnabled = _logger.IsEnabled(LogLevel.Critical); - if (loggingEnabled || diagnosticListenerActivityCreationEnabled || _activitySource.HasListeners()) { context.Activity = StartActivity(httpContext, loggingEnabled, diagnosticListenerActivityCreationEnabled, out var hasDiagnosticListener); @@ -305,7 +304,7 @@ private static void RecordRequestStartEventLog(HttpContext httpContext) }); // AddBaggage adds items at the beginning of the list, so we need to add them in reverse to keep the same order as the client - // By contract, the propagator has already reversed the order of items so we need not reverse it again + // By contract, the propagator has already reversed the order of items so we need not reverse it again // Order could be important if baggage has two items with the same key (that is allowed by the contract) if (baggage is not null) { diff --git a/src/Hosting/Hosting/src/Server/Features/ServerAddressesFeature.cs b/src/Hosting/Hosting/src/Server/Features/ServerAddressesFeature.cs index a5899bed738f..016dd32ddd78 100644 --- a/src/Hosting/Hosting/src/Server/Features/ServerAddressesFeature.cs +++ b/src/Hosting/Hosting/src/Server/Features/ServerAddressesFeature.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Hosting.Server.Features; /// diff --git a/src/Hosting/Hosting/src/WebHostExtensions.cs b/src/Hosting/Hosting/src/WebHostExtensions.cs index 9ec9293e479a..f5f3bfb051eb 100644 --- a/src/Hosting/Hosting/src/WebHostExtensions.cs +++ b/src/Hosting/Hosting/src/WebHostExtensions.cs @@ -119,7 +119,6 @@ private static async Task RunAsync(this IWebHost host, CancellationToken token, Console.WriteLine($"Hosting environment: {hostingEnvironment?.EnvironmentName}"); Console.WriteLine($"Content root path: {hostingEnvironment?.ContentRootPath}"); - var serverAddresses = host.ServerFeatures.Get()?.Addresses; if (serverAddresses != null) { diff --git a/src/Hosting/Hosting/test/HostingApplicationDiagnosticsTests.cs b/src/Hosting/Hosting/test/HostingApplicationDiagnosticsTests.cs index 029206f0c97c..aa3ea8b44182 100644 --- a/src/Hosting/Hosting/test/HostingApplicationDiagnosticsTests.cs +++ b/src/Hosting/Hosting/test/HostingApplicationDiagnosticsTests.cs @@ -65,7 +65,6 @@ public void ActivityStopDoesNotFireIfNoListenerAttachedForStart() return false; }); - // Act var context = hostingApplication.CreateContext(features); @@ -357,7 +356,6 @@ public void ActivityBaggagePrefersW3CBaggageHeaderName() Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value4"); } - [Fact] public void ActivityBaggagePreservesItemsOrder() { @@ -520,7 +518,6 @@ public void ActivityListenersAreCalled() Assert.Equal("0123456789abcdef", parentSpanId); } - private static void AssertProperty(object o, string name) { Assert.NotNull(o); diff --git a/src/Hosting/Hosting/test/StartupManagerTests.cs b/src/Hosting/Hosting/test/StartupManagerTests.cs index 34428eb1be4e..1871d257be8b 100644 --- a/src/Hosting/Hosting/test/StartupManagerTests.cs +++ b/src/Hosting/Hosting/test/StartupManagerTests.cs @@ -275,7 +275,6 @@ public void Configure(IApplicationBuilder builder) } } - public class ServiceBefore { public string Message { get; set; } diff --git a/src/Hosting/Hosting/test/WebHostBuilderTests.cs b/src/Hosting/Hosting/test/WebHostBuilderTests.cs index 9db5a78c4af9..0d39d77b70a2 100644 --- a/src/Hosting/Hosting/test/WebHostBuilderTests.cs +++ b/src/Hosting/Hosting/test/WebHostBuilderTests.cs @@ -601,7 +601,6 @@ public void UseEnvironmentIsNotOverriden(IWebHostBuilder builder) var expected = "MY_TEST_ENVIRONMENT"; - using (var host = builder .UseConfiguration(config) .UseEnvironment(expected) diff --git a/src/Hosting/TestHost/test/TestServerTests.cs b/src/Hosting/TestHost/test/TestServerTests.cs index 65afe138740e..9e2349bc04e5 100644 --- a/src/Hosting/TestHost/test/TestServerTests.cs +++ b/src/Hosting/TestHost/test/TestServerTests.cs @@ -269,7 +269,6 @@ public void TestServerConstructorWithFeatureCollectionAllowsInitializingServerFe Assert.Contains(serverAddressesFeature.Addresses, s => string.Equals(s, url, StringComparison.Ordinal)); }); - var featureCollection = new FeatureCollection(); featureCollection.Set(new ServerAddressesFeature()); diff --git a/src/Hosting/test/FunctionalTests/Properties/AssemblyInfo.cs b/src/Hosting/test/FunctionalTests/Properties/AssemblyInfo.cs index 3abdc2cafcee..310cd189cb18 100644 --- a/src/Hosting/test/FunctionalTests/Properties/AssemblyInfo.cs +++ b/src/Hosting/test/FunctionalTests/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] diff --git a/src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/Program.cs b/src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/Program.cs index d4c93d17dc64..e211da9e1405 100644 --- a/src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/Program.cs +++ b/src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/Program.cs @@ -73,5 +73,3 @@ public Task StopAsync(CancellationToken cancellationToken) return Task.CompletedTask; } } - - diff --git a/src/Http/Authentication.Abstractions/src/AuthenticationToken.cs b/src/Http/Authentication.Abstractions/src/AuthenticationToken.cs index 51f7ee9e559a..4cd79fc9457a 100644 --- a/src/Http/Authentication.Abstractions/src/AuthenticationToken.cs +++ b/src/Http/Authentication.Abstractions/src/AuthenticationToken.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - namespace Microsoft.AspNetCore.Authentication; /// diff --git a/src/Http/Authentication.Core/test/AuthenticationSchemeProviderTests.cs b/src/Http/Authentication.Core/test/AuthenticationSchemeProviderTests.cs index 40ba847982ed..c51e29201a6d 100644 --- a/src/Http/Authentication.Core/test/AuthenticationSchemeProviderTests.cs +++ b/src/Http/Authentication.Core/test/AuthenticationSchemeProviderTests.cs @@ -44,7 +44,6 @@ public async Task DefaultSchemesFallbackToDefaultScheme() Assert.Equal("B", (await provider.GetDefaultSignOutSchemeAsync())!.Name); } - [Fact] public async Task DefaultSignOutFallsbackToSignIn() { diff --git a/src/Http/Headers/src/MediaTypeHeaderValue.cs b/src/Http/Headers/src/MediaTypeHeaderValue.cs index c69c9f31d238..60e823eba443 100644 --- a/src/Http/Headers/src/MediaTypeHeaderValue.cs +++ b/src/Http/Headers/src/MediaTypeHeaderValue.cs @@ -314,7 +314,6 @@ public StringSegment Suffix } } - /// /// Get a of facets of the . Facets are a /// period separated list of StringSegments in the . diff --git a/src/Http/Headers/test/CacheControlHeaderValueTest.cs b/src/Http/Headers/test/CacheControlHeaderValueTest.cs index 948218fec298..12a5e209398c 100644 --- a/src/Http/Headers/test/CacheControlHeaderValueTest.cs +++ b/src/Http/Headers/test/CacheControlHeaderValueTest.cs @@ -231,7 +231,6 @@ public void GetHashCode_CompareCollectionFieldsSet_MatchExpectation() cacheControl3.PrivateHeaders.Add("PLACEHOLDER2"); CompareHashCodes(cacheControl1, cacheControl3, false); - cacheControl4.Extensions.Add(new NameValueHeaderValue("custom")); CompareHashCodes(cacheControl1, cacheControl4, false); diff --git a/src/Http/Headers/test/NameValueHeaderValueTest.cs b/src/Http/Headers/test/NameValueHeaderValueTest.cs index 8f0d13a3152d..003ee695c7f6 100644 --- a/src/Http/Headers/test/NameValueHeaderValueTest.cs +++ b/src/Http/Headers/test/NameValueHeaderValueTest.cs @@ -605,7 +605,6 @@ public void SetAndEscapeValue_ReturnsExpectedValue(string input, string expected Assert.Equal(expected, actual); } - [Theory] [InlineData("\n")] [InlineData("\b")] @@ -646,7 +645,6 @@ public void OverescapingValuesDoNotRoundTrip(string input) Assert.NotEqual(input, actual); } - #region Helper methods private void CheckValidParse(string? input, NameValueHeaderValue expectedResult) diff --git a/src/Http/Headers/test/SetCookieHeaderValueTest.cs b/src/Http/Headers/test/SetCookieHeaderValueTest.cs index 044d8b0e1c19..8ab14433519b 100644 --- a/src/Http/Headers/test/SetCookieHeaderValueTest.cs +++ b/src/Http/Headers/test/SetCookieHeaderValueTest.cs @@ -180,7 +180,6 @@ public static TheoryData InvalidCookieValues header9.Extensions.Add("extension2=value"); var string9 = "name9=value9; extension1; extension2=value"; - dataset.Add(new[] { header1 }.ToList(), new[] { string1 }); dataset.Add(new[] { header1, header1 }.ToList(), new[] { string1, string1 }); dataset.Add(new[] { header1, header1 }.ToList(), new[] { string1, null, "", " ", ",", " , ", string1 }); diff --git a/src/Http/Http.Abstractions/src/Extensions/MapWhenExtensions.cs b/src/Http/Http.Abstractions/src/Extensions/MapWhenExtensions.cs index 7efd057cca8b..e5b77a919409 100644 --- a/src/Http/Http.Abstractions/src/Extensions/MapWhenExtensions.cs +++ b/src/Http/Http.Abstractions/src/Extensions/MapWhenExtensions.cs @@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Builder.Extensions; using Microsoft.AspNetCore.Http; - namespace Microsoft.AspNetCore.Builder; using Predicate = Func; diff --git a/src/Http/Http.Abstractions/test/HttpMethodslTests.cs b/src/Http/Http.Abstractions/test/HttpMethodslTests.cs index 7c4114980393..c9d79ecbd6f6 100644 --- a/src/Http/Http.Abstractions/test/HttpMethodslTests.cs +++ b/src/Http/Http.Abstractions/test/HttpMethodslTests.cs @@ -33,7 +33,6 @@ public void CanonicalizedValue_Success() } } - private void CanonicalizedValueTest(string method, string expectedMethod) { string inputMethod = CreateStringAtRuntime(method); diff --git a/src/Http/Http.Abstractions/test/RouteValueDictionaryTests.cs b/src/Http/Http.Abstractions/test/RouteValueDictionaryTests.cs index 902c0e45df27..474cc6064b55 100644 --- a/src/Http/Http.Abstractions/test/RouteValueDictionaryTests.cs +++ b/src/Http/Http.Abstractions/test/RouteValueDictionaryTests.cs @@ -1484,7 +1484,6 @@ public void Remove_ListStorage_True_CaseInsensitive() Assert.IsType[]>(dict._arrayStorage); } - [Fact] public void Remove_KeyAndOutValue_EmptyStorage() { diff --git a/src/Http/Http.Extensions/src/HttpRequestJsonExtensions.cs b/src/Http/Http.Extensions/src/HttpRequestJsonExtensions.cs index 79247df16511..1dfc5e525ae1 100644 --- a/src/Http/Http.Extensions/src/HttpRequestJsonExtensions.cs +++ b/src/Http/Http.Extensions/src/HttpRequestJsonExtensions.cs @@ -181,7 +181,6 @@ private static bool HasJsonContentType(this HttpRequest request, out StringSegme return false; } - private static JsonSerializerOptions ResolveSerializerOptions(HttpContext httpContext) { // Attempt to resolve options from DI then fallback to default options diff --git a/src/Http/Http.Extensions/test/HttpRequestExtensionsTests.cs b/src/Http/Http.Extensions/test/HttpRequestExtensionsTests.cs index 273b789ffe8f..bd6735818e55 100644 --- a/src/Http/Http.Extensions/test/HttpRequestExtensionsTests.cs +++ b/src/Http/Http.Extensions/test/HttpRequestExtensionsTests.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - #nullable enable namespace Microsoft.AspNetCore.Http.Extensions.Tests; diff --git a/src/Http/Http.Extensions/test/RequestDelegateFactoryTests.cs b/src/Http/Http.Extensions/test/RequestDelegateFactoryTests.cs index ef22b01c11a0..f3e27b658767 100644 --- a/src/Http/Http.Extensions/test/RequestDelegateFactoryTests.cs +++ b/src/Http/Http.Extensions/test/RequestDelegateFactoryTests.cs @@ -821,7 +821,6 @@ public async Task RequestDelegateUsesTryParseOverBindAsyncGivenExplicitAttribute var fromRouteFactoryResult = RequestDelegateFactory.Create((HttpContext httpContext, [FromRoute] MyBindAsyncRecord myBindAsyncRecord) => { }); var fromQueryFactoryResult = RequestDelegateFactory.Create((HttpContext httpContext, [FromQuery] MyBindAsyncRecord myBindAsyncRecord) => { }); - var httpContext = CreateHttpContext(); httpContext.Request.RouteValues["myBindAsyncRecord"] = "foo"; httpContext.Request.Query = new QueryCollection(new Dictionary @@ -2221,7 +2220,6 @@ public static IEnumerable StringResult new object[] { (Func>)StaticStringAsTaskObjectTestAction }, new object[] { (Func>)StaticStringAsValueTaskObjectTestAction }, - }; } } @@ -2664,7 +2662,6 @@ void requiredReferenceTypeSimple(HttpContext context, MySimpleBindAsyncRecord my context.Items["uri"] = mySimpleBindAsyncRecord.Uri; } - void requiredValueType(HttpContext context, MyNullableBindAsyncStruct myNullableBindAsyncStruct) { context.Items["uri"] = myNullableBindAsyncStruct.Uri; @@ -2811,7 +2808,6 @@ public async Task RequestDelegateHandlesServiceParamOptionality(Delegate @delega } } - public static IEnumerable AllowEmptyData { get diff --git a/src/Http/Http.Results/src/Results.cs b/src/Http/Http.Results/src/Results.cs index e7ce747ab73c..6b4c09e1cbc3 100644 --- a/src/Http/Http.Results/src/Results.cs +++ b/src/Http/Http.Results/src/Results.cs @@ -250,7 +250,6 @@ public static IResult Bytes( EntityTag = entityTag, }; - /// /// Writes the specified to the response. /// diff --git a/src/Http/Http/perf/Microbenchmarks/AdaptiveCapacityDictionaryBenchmark.cs b/src/Http/Http/perf/Microbenchmarks/AdaptiveCapacityDictionaryBenchmark.cs index c69cfead0404..76a8fa7357a6 100644 --- a/src/Http/Http/perf/Microbenchmarks/AdaptiveCapacityDictionaryBenchmark.cs +++ b/src/Http/Http/perf/Microbenchmarks/AdaptiveCapacityDictionaryBenchmark.cs @@ -80,7 +80,6 @@ public void OneValue_Dict_Set() _dict[_oneValue.Key] = _oneValue.Value; } - [Benchmark] public void OneValue_SmallDict_Get() { @@ -170,7 +169,6 @@ public void TenValues_SmallDict() } } - [Benchmark] public void FourValues_Dict() { @@ -305,7 +303,6 @@ public void Dict() _ = new Dictionary(capacity: 1); } - [Benchmark] public void SmallDictFour() { diff --git a/src/Http/Http/test/DefaultHttpContextTests.cs b/src/Http/Http/test/DefaultHttpContextTests.cs index eba7cbe4f4c5..11c458f13587 100644 --- a/src/Http/Http/test/DefaultHttpContextTests.cs +++ b/src/Http/Http/test/DefaultHttpContextTests.cs @@ -168,7 +168,6 @@ public void UpdateFeatures_ClearsCachedFeatures() context.Uninitialize(); TestCachedFeaturesAreNull(context, null); - var newFeatures = new FeatureCollection(); newFeatures.Set(new HttpRequestFeature()); newFeatures.Set(new HttpResponseFeature()); diff --git a/src/Http/Http/test/Features/FormFeatureTests.cs b/src/Http/Http/test/Features/FormFeatureTests.cs index e0b089065243..f58b47c53d82 100644 --- a/src/Http/Http/test/Features/FormFeatureTests.cs +++ b/src/Http/Http/test/Features/FormFeatureTests.cs @@ -474,7 +474,6 @@ public async Task ReadFormAsync_ValueCountLimitExceededWithFiles_Throw(bool buff formContent.AddRange(Encoding.UTF8.GetBytes(MultipartFormFile)); formContent.AddRange(Encoding.UTF8.GetBytes(MultipartFormEnd)); - var context = new DefaultHttpContext(); var responseFeature = new FakeResponseFeature(); context.Features.Set(responseFeature); diff --git a/src/Http/Routing/src/Builder/EndpointRouteBuilderExtensions.cs b/src/Http/Routing/src/Builder/EndpointRouteBuilderExtensions.cs index 7d124a1f2f46..ab00f5ff2749 100644 --- a/src/Http/Routing/src/Builder/EndpointRouteBuilderExtensions.cs +++ b/src/Http/Routing/src/Builder/EndpointRouteBuilderExtensions.cs @@ -207,7 +207,6 @@ public static IEndpointConventionBuilder Map( return dataSource.AddEndpointBuilder(builder); } - /// /// Adds a to the that matches HTTP GET requests /// for the specified pattern. @@ -272,7 +271,6 @@ public static RouteHandlerBuilder MapDelete( return MapMethods(endpoints, pattern, DeleteVerb, handler); } - /// /// Adds a to the that matches HTTP PATCH requests /// for the specified pattern. diff --git a/src/Http/Routing/src/Builder/OpenApiRouteHandlerBuilderExtensions.cs b/src/Http/Routing/src/Builder/OpenApiRouteHandlerBuilderExtensions.cs index 46daeb65f717..31696a3da7be 100644 --- a/src/Http/Routing/src/Builder/OpenApiRouteHandlerBuilderExtensions.cs +++ b/src/Http/Routing/src/Builder/OpenApiRouteHandlerBuilderExtensions.cs @@ -192,7 +192,6 @@ public static RouteHandlerBuilder Accepts(this RouteHandlerBuilder builder, return builder; } - /// /// Adds to for all builders /// produced by . diff --git a/src/Http/Routing/src/DecisionTree/DecisionCriterion.cs b/src/Http/Routing/src/DecisionTree/DecisionCriterion.cs index 44d72ddf9990..eae3d5ff3d9d 100644 --- a/src/Http/Routing/src/DecisionTree/DecisionCriterion.cs +++ b/src/Http/Routing/src/DecisionTree/DecisionCriterion.cs @@ -3,7 +3,6 @@ #nullable disable - namespace Microsoft.AspNetCore.Routing.DecisionTree; internal class DecisionCriterion diff --git a/src/Http/Routing/src/DecisionTree/DecisionTreeNode.cs b/src/Http/Routing/src/DecisionTree/DecisionTreeNode.cs index 8916316de2ff..15a09aa0a829 100644 --- a/src/Http/Routing/src/DecisionTree/DecisionTreeNode.cs +++ b/src/Http/Routing/src/DecisionTree/DecisionTreeNode.cs @@ -3,7 +3,6 @@ #nullable disable - namespace Microsoft.AspNetCore.Routing.DecisionTree; // Data structure representing a node in a decision tree. These are created in DecisionTreeBuilder diff --git a/src/Http/Routing/src/DecisionTree/ItemDescriptor.cs b/src/Http/Routing/src/DecisionTree/ItemDescriptor.cs index 2abeaea88a15..2837e3d77cb9 100644 --- a/src/Http/Routing/src/DecisionTree/ItemDescriptor.cs +++ b/src/Http/Routing/src/DecisionTree/ItemDescriptor.cs @@ -3,7 +3,6 @@ #nullable disable - namespace Microsoft.AspNetCore.Routing.DecisionTree; internal class ItemDescriptor diff --git a/src/Http/Routing/src/Matching/AcceptsMatcherPolicy.cs b/src/Http/Routing/src/Matching/AcceptsMatcherPolicy.cs index f509f42d191f..67c032148016 100644 --- a/src/Http/Routing/src/Matching/AcceptsMatcherPolicy.cs +++ b/src/Http/Routing/src/Matching/AcceptsMatcherPolicy.cs @@ -251,7 +251,6 @@ public IReadOnlyList GetEdges(IReadOnlyList endpoints) edges.Add(string.Empty, anyEndpoints.ToList()); } - return edges .Select(kvp => new PolicyNodeEdge(kvp.Key, kvp.Value)) .ToArray(); diff --git a/src/Http/Routing/src/Matching/DictionaryJumpTable.cs b/src/Http/Routing/src/Matching/DictionaryJumpTable.cs index 06dad38812df..59380d9198eb 100644 --- a/src/Http/Routing/src/Matching/DictionaryJumpTable.cs +++ b/src/Http/Routing/src/Matching/DictionaryJumpTable.cs @@ -59,7 +59,6 @@ public override string DebuggerToString() builder.Append(" }"); - return builder.ToString(); } } diff --git a/src/Http/Routing/src/Matching/HostMatcherPolicy.cs b/src/Http/Routing/src/Matching/HostMatcherPolicy.cs index c3b06f0d4de8..0a1234043864 100644 --- a/src/Http/Routing/src/Matching/HostMatcherPolicy.cs +++ b/src/Http/Routing/src/Matching/HostMatcherPolicy.cs @@ -451,7 +451,6 @@ public bool MatchHost(string host) return true; } - public override int GetHashCode() { return (Host?.GetHashCode() ?? 0) ^ (Port?.GetHashCode() ?? 0); diff --git a/src/Http/Routing/src/Matching/ILEmitTrieJumpTable.cs b/src/Http/Routing/src/Matching/ILEmitTrieJumpTable.cs index 7f3771db13a2..386dc30a4953 100644 --- a/src/Http/Routing/src/Matching/ILEmitTrieJumpTable.cs +++ b/src/Http/Routing/src/Matching/ILEmitTrieJumpTable.cs @@ -3,7 +3,6 @@ #nullable disable - namespace Microsoft.AspNetCore.Routing.Matching; // Uses generated IL to implement the JumpTable contract. This approach requires diff --git a/src/Http/Routing/src/PathTokenizer.cs b/src/Http/Routing/src/PathTokenizer.cs index 6a9baf1cbd0c..4f378185318d 100644 --- a/src/Http/Routing/src/PathTokenizer.cs +++ b/src/Http/Routing/src/PathTokenizer.cs @@ -73,7 +73,6 @@ public StringSegment this[int index] throw new IndexOutOfRangeException(); } - var currentSegmentIndex = 0; var currentSegmentStart = 1; diff --git a/src/Http/Routing/src/Patterns/DefaultRoutePatternTransformer.cs b/src/Http/Routing/src/Patterns/DefaultRoutePatternTransformer.cs index 49249c7954f5..de56b5e06c2c 100644 --- a/src/Http/Routing/src/Patterns/DefaultRoutePatternTransformer.cs +++ b/src/Http/Routing/src/Patterns/DefaultRoutePatternTransformer.cs @@ -3,7 +3,6 @@ #nullable disable - namespace Microsoft.AspNetCore.Routing.Patterns; internal class DefaultRoutePatternTransformer : RoutePatternTransformer diff --git a/src/Http/Routing/test/UnitTests/Constraints/FIleNameRouteConstraintTest.cs b/src/Http/Routing/test/UnitTests/Constraints/FileNameRouteConstraintTest.cs similarity index 99% rename from src/Http/Routing/test/UnitTests/Constraints/FIleNameRouteConstraintTest.cs rename to src/Http/Routing/test/UnitTests/Constraints/FileNameRouteConstraintTest.cs index 046a55cd2cb2..4995d660d42a 100644 --- a/src/Http/Routing/test/UnitTests/Constraints/FIleNameRouteConstraintTest.cs +++ b/src/Http/Routing/test/UnitTests/Constraints/FileNameRouteConstraintTest.cs @@ -24,7 +24,6 @@ public static TheoryData FileNameData } } - [Theory] [MemberData(nameof(FileNameData))] public void Match_RouteValue_IsFileName(object value) diff --git a/src/Http/Routing/test/UnitTests/DefaultLinkGeneratorProcessTemplateTest.cs b/src/Http/Routing/test/UnitTests/DefaultLinkGeneratorProcessTemplateTest.cs index 712fe00c9bea..67183a428911 100644 --- a/src/Http/Routing/test/UnitTests/DefaultLinkGeneratorProcessTemplateTest.cs +++ b/src/Http/Routing/test/UnitTests/DefaultLinkGeneratorProcessTemplateTest.cs @@ -496,7 +496,6 @@ public void TryProcessTemplate_LowercaseUrlSetToTrue_OnRouteOptions_OverridenByC }, result: out var result); - // Assert Assert.True(success); Assert.Equal("/HoMe/InDex", result.path.ToUriComponent()); @@ -781,7 +780,6 @@ public void GetLinkWithNonParameterConstraintReturnsUrlWithoutQueryString() target.VerifyAll(); } - // Any ambient values from the current request should be visible to constraint, even // if they have nothing to do with the route generating a link [Fact] @@ -1286,7 +1284,6 @@ public void TryProcessTemplate_OptionalParameter_FollowedByDotAfterSlash_Paramet options: null, result: out var result); - Assert.True(success); Assert.Equal("/Home/Index/", result.path.ToUriComponent()); Assert.Equal(string.Empty, result.query.ToUriComponent()); diff --git a/src/Http/Routing/test/UnitTests/InlineRouteParameterParserTests.cs b/src/Http/Routing/test/UnitTests/InlineRouteParameterParserTests.cs index 9ed7581ac89e..4b9472fb51ef 100644 --- a/src/Http/Routing/test/UnitTests/InlineRouteParameterParserTests.cs +++ b/src/Http/Routing/test/UnitTests/InlineRouteParameterParserTests.cs @@ -941,7 +941,6 @@ public void ParseRouteParameter_ParameterWithoutInlineConstraint_ReturnsTemplate Assert.Null(templatePart.DefaultValue); } - private TemplatePart ParseParameter(string routeParameter) { var _constraintResolver = GetConstraintResolver(); diff --git a/src/Http/Routing/test/UnitTests/Matching/DfaMatcherBuilderTest.cs b/src/Http/Routing/test/UnitTests/Matching/DfaMatcherBuilderTest.cs index e04f88391d4d..fcf535b96478 100644 --- a/src/Http/Routing/test/UnitTests/Matching/DfaMatcherBuilderTest.cs +++ b/src/Http/Routing/test/UnitTests/Matching/DfaMatcherBuilderTest.cs @@ -3560,7 +3560,6 @@ private class TestMetadata2MatcherPolicy : MatcherPolicy, IEndpointComparerPolic public Action> OnGetEdges { get; set; } - public bool AppliesToEndpoints(IReadOnlyList endpoints) { return endpoints.Any(e => e.Metadata.GetMetadata() != null); diff --git a/src/Http/Routing/test/UnitTests/Matching/HttpMethodMatcherPolicyIntegrationTestBase.cs b/src/Http/Routing/test/UnitTests/Matching/HttpMethodMatcherPolicyIntegrationTestBase.cs index 49d4b7d2a118..27e771550a1a 100644 --- a/src/Http/Routing/test/UnitTests/Matching/HttpMethodMatcherPolicyIntegrationTestBase.cs +++ b/src/Http/Routing/test/UnitTests/Matching/HttpMethodMatcherPolicyIntegrationTestBase.cs @@ -62,7 +62,6 @@ public async Task Match_HttpMethod_CORS_Preflight() MatcherAssert.AssertMatch(httpContext, endpoint); } - [Fact] // Nothing here supports OPTIONS, so it goes to a 405. public async Task NotMatch_HttpMethod_CORS_Preflight() { diff --git a/src/Http/Routing/test/UnitTests/Matching/LinearSearchJumpTableTest.cs b/src/Http/Routing/test/UnitTests/Matching/LinearSearchJumpTableTest.cs index ff177bf528dc..729664b38a09 100644 --- a/src/Http/Routing/test/UnitTests/Matching/LinearSearchJumpTableTest.cs +++ b/src/Http/Routing/test/UnitTests/Matching/LinearSearchJumpTableTest.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - namespace Microsoft.AspNetCore.Routing.Matching; public class LinearSearchJumpTableTest : MultipleEntryJumpTableTest diff --git a/src/Http/Routing/test/UnitTests/RouteTest.cs b/src/Http/Routing/test/UnitTests/RouteTest.cs index 54f9d9999b9d..3042f805ca1d 100644 --- a/src/Http/Routing/test/UnitTests/RouteTest.cs +++ b/src/Http/Routing/test/UnitTests/RouteTest.cs @@ -1426,7 +1426,6 @@ public void GetVirtualPath_TwoOptionalParameters_OneValueFromAmbientValues() Assert.Empty(pathData.DataTokens); } - [Fact] public void GetVirtualPath_OptionalParameterAfterDefault_OneValueFromAmbientValues() { diff --git a/src/Http/Routing/test/UnitTests/Template/TemplateParserTests.cs b/src/Http/Routing/test/UnitTests/Template/TemplateParserTests.cs index b412b86acce2..64ddae5701c4 100644 --- a/src/Http/Routing/test/UnitTests/Template/TemplateParserTests.cs +++ b/src/Http/Routing/test/UnitTests/Template/TemplateParserTests.cs @@ -308,7 +308,6 @@ public void Parse_ComplexSegment_OptionalParameterFollowingPeriod_ThreeParameter defaultValue: null, inlineConstraints: null)); - expected.Parameters.Add(expected.Segments[0].Parts[0]); expected.Parameters.Add(expected.Segments[0].Parts[2]); expected.Parameters.Add(expected.Segments[0].Parts[4]); @@ -347,7 +346,6 @@ public void Parse_ComplexSegment_ThreeParametersSeparatedByPeriod() defaultValue: null, inlineConstraints: null)); - expected.Parameters.Add(expected.Segments[0].Parts[0]); expected.Parameters.Add(expected.Segments[0].Parts[2]); expected.Parameters.Add(expected.Segments[0].Parts[4]); diff --git a/src/Http/Routing/test/UnitTests/Tree/TreeRouterTest.cs b/src/Http/Routing/test/UnitTests/Tree/TreeRouterTest.cs index 66231caa6f05..3658dbd5a63b 100644 --- a/src/Http/Routing/test/UnitTests/Tree/TreeRouterTest.cs +++ b/src/Http/Routing/test/UnitTests/Tree/TreeRouterTest.cs @@ -1105,7 +1105,6 @@ public void TreeRouter_GenerateLink_CreatesLinksForRoutesWithIntermediateDefault Assert.Equal("/a/b/3/d", result.VirtualPath); } - [Fact] public void TreeRouter_GeneratesLink_ForMultipleNamedEntriesWithTheSameTemplate() { @@ -2049,7 +2048,6 @@ private static OutboundRouteEntry MapOutboundEntry( return entry; } - private static string CreateRouteGroup(int order, string template) { return string.Format(CultureInfo.InvariantCulture, "{0}&{1}", order, template); diff --git a/src/Http/WebUtilities/src/AspNetCoreTempDirectory.cs b/src/Http/WebUtilities/src/AspNetCoreTempDirectory.cs index b9052a0cda72..6a4b3aa1f3c4 100644 --- a/src/Http/WebUtilities/src/AspNetCoreTempDirectory.cs +++ b/src/Http/WebUtilities/src/AspNetCoreTempDirectory.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Internal; internal static class AspNetCoreTempDirectory diff --git a/src/Http/WebUtilities/test/FormPipeReaderTests.cs b/src/Http/WebUtilities/test/FormPipeReaderTests.cs index 07c160da4093..1b3b88c594df 100644 --- a/src/Http/WebUtilities/test/FormPipeReaderTests.cs +++ b/src/Http/WebUtilities/test/FormPipeReaderTests.cs @@ -123,7 +123,6 @@ public async Task ReadFormAsync_ValueCountLimitExceededSameKey_Throw() () => ReadFormAsync(new FormPipeReader(bodyPipe) { ValueCountLimit = 3 })); Assert.Equal("Form value count limit 3 exceeded.", exception.Message); - // The body pipe is still readable and has not advanced. var readResult = await bodyPipe.ReadAsync(); Assert.Equal(Encoding.UTF8.GetBytes(content), readResult.Buffer.ToArray()); diff --git a/src/Http/WebUtilities/test/HttpRequestStreamReaderTest.cs b/src/Http/WebUtilities/test/HttpRequestStreamReaderTest.cs index a8387ca3b65a..261841a8b487 100644 --- a/src/Http/WebUtilities/test/HttpRequestStreamReaderTest.cs +++ b/src/Http/WebUtilities/test/HttpRequestStreamReaderTest.cs @@ -5,38 +5,37 @@ using System.Text; using Moq; - namespace Microsoft.AspNetCore.WebUtilities; public class HttpRequestStreamReaderTest { private static readonly char[] CharData = new char[] { - char.MinValue, - char.MaxValue, - '\t', - ' ', - '$', - '@', - '#', - '\0', - '\v', - '\'', - '\u3190', - '\uC3A0', - 'A', - '5', - '\r', - '\uFE70', - '-', - ';', - '\r', - '\n', - 'T', - '3', - '\n', - 'K', - '\u00E6', + char.MinValue, + char.MaxValue, + '\t', + ' ', + '$', + '@', + '#', + '\0', + '\v', + '\'', + '\u3190', + '\uC3A0', + 'A', + '5', + '\r', + '\uFE70', + '-', + ';', + '\r', + '\n', + 'T', + '3', + '\n', + 'K', + '\u00E6', }; [Fact] diff --git a/src/Http/WebUtilities/test/HttpResponseStreamWriterTest.cs b/src/Http/WebUtilities/test/HttpResponseStreamWriterTest.cs index 46fc774d1d5e..3d01a6cd6b43 100644 --- a/src/Http/WebUtilities/test/HttpResponseStreamWriterTest.cs +++ b/src/Http/WebUtilities/test/HttpResponseStreamWriterTest.cs @@ -785,7 +785,6 @@ await Assert.ThrowsAsync(() => }); } - private class TestMemoryStream : MemoryStream { public int FlushCallCount { get; private set; } diff --git a/src/Http/samples/MinimalSample/Program.cs b/src/Http/samples/MinimalSample/Program.cs index 4cac78aa6c60..080d31fb5cb3 100644 --- a/src/Http/samples/MinimalSample/Program.cs +++ b/src/Http/samples/MinimalSample/Program.cs @@ -13,7 +13,6 @@ string Plaintext() => "Hello, World!"; app.MapGet("/plaintext", Plaintext); - object Json() => new { message = "Hello, World!" }; app.MapGet("/json", Json); diff --git a/src/HttpClientFactory/Polly/src/Properties/AssemblyInfo.cs b/src/HttpClientFactory/Polly/src/Properties/AssemblyInfo.cs index 57e7258920dd..9c7898e3fbc9 100644 --- a/src/HttpClientFactory/Polly/src/Properties/AssemblyInfo.cs +++ b/src/HttpClientFactory/Polly/src/Properties/AssemblyInfo.cs @@ -3,5 +3,4 @@ using System.Runtime.CompilerServices; - [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/AuthenticationBuilderExtensions.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/AuthenticationBuilderExtensions.cs index 0647f9ae27b3..56f0fe6634f8 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/AuthenticationBuilderExtensions.cs +++ b/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/AuthenticationBuilderExtensions.cs @@ -44,7 +44,6 @@ public static AuthenticationBuilder AddIdentityServerJwt(this AuthenticationBuil }) .AddJwtBearer(IdentityServerJwtConstants.IdentityServerJwtBearerScheme, null, o => { }); - return builder; static IdentityServerJwtBearerOptionsConfiguration JwtBearerOptionsFactory(IServiceProvider sp) diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/SigningKeysLoaderTests.cs b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/SigningKeysLoaderTests.cs index 567da7fd985e..259f70f97b95 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/SigningKeysLoaderTests.cs +++ b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/SigningKeysLoaderTests.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Security.Cryptography.X509Certificates; using Microsoft.AspNetCore.Testing; diff --git a/src/Identity/Core/src/DataProtectorTokenProvider.cs b/src/Identity/Core/src/DataProtectorTokenProvider.cs index 62909b8dd2bd..dbb835ce1218 100644 --- a/src/Identity/Core/src/DataProtectorTokenProvider.cs +++ b/src/Identity/Core/src/DataProtectorTokenProvider.cs @@ -160,7 +160,6 @@ public virtual async Task ValidateAsync(string purpose, string token, User return isEqualsSecurityStamp; } - var stampIsEmpty = stamp == ""; if (!stampIsEmpty) { diff --git a/src/Identity/EntityFrameworkCore/src/RoleStore.cs b/src/Identity/EntityFrameworkCore/src/RoleStore.cs index f2d018dbcbb7..542cfed3615f 100644 --- a/src/Identity/EntityFrameworkCore/src/RoleStore.cs +++ b/src/Identity/EntityFrameworkCore/src/RoleStore.cs @@ -95,7 +95,6 @@ public RoleStore(TContext context, IdentityErrorDescriber describer = null) private bool _disposed; - /// /// Gets the database context for this store. /// diff --git a/src/Identity/EntityFrameworkCore/src/UserOnlyStore.cs b/src/Identity/EntityFrameworkCore/src/UserOnlyStore.cs index d20a00fe68a5..4127a35528f3 100644 --- a/src/Identity/EntityFrameworkCore/src/UserOnlyStore.cs +++ b/src/Identity/EntityFrameworkCore/src/UserOnlyStore.cs @@ -551,7 +551,6 @@ protected override Task AddUserTokenAsync(TUserToken token) return Task.CompletedTask; } - /// /// Remove a new user token. /// diff --git a/src/Identity/EntityFrameworkCore/test/EF.InMemory.Test/InMemoryStoreWithGenericsTest.cs b/src/Identity/EntityFrameworkCore/test/EF.InMemory.Test/InMemoryStoreWithGenericsTest.cs index dca7b3a7a1a3..367fcc16c000 100644 --- a/src/Identity/EntityFrameworkCore/test/EF.InMemory.Test/InMemoryStoreWithGenericsTest.cs +++ b/src/Identity/EntityFrameworkCore/test/EF.InMemory.Test/InMemoryStoreWithGenericsTest.cs @@ -176,7 +176,6 @@ public int GetHashCode(Claim obj) } } - #region Generic Type defintions public class IdentityUserWithGenerics : IdentityUser diff --git a/src/Identity/EntityFrameworkCore/test/EF.Test/SqlStoreOnlyUsersTestBase.cs b/src/Identity/EntityFrameworkCore/test/EF.Test/SqlStoreOnlyUsersTestBase.cs index 2fec9af2c658..593b4f75e9b7 100644 --- a/src/Identity/EntityFrameworkCore/test/EF.Test/SqlStoreOnlyUsersTestBase.cs +++ b/src/Identity/EntityFrameworkCore/test/EF.Test/SqlStoreOnlyUsersTestBase.cs @@ -116,7 +116,6 @@ public async Task DeleteUserRemovesTokensTest() Assert.Null(await userMgr.GetAuthenticationTokenAsync(user, "provider", "test")); } - [ConditionalFact] public void CanCreateUserUsingEF() { diff --git a/src/Identity/EntityFrameworkCore/test/EF.Test/SqlStoreTestBase.cs b/src/Identity/EntityFrameworkCore/test/EF.Test/SqlStoreTestBase.cs index 620d2404926b..ead8b7d3950f 100644 --- a/src/Identity/EntityFrameworkCore/test/EF.Test/SqlStoreTestBase.cs +++ b/src/Identity/EntityFrameworkCore/test/EF.Test/SqlStoreTestBase.cs @@ -215,7 +215,6 @@ public async Task DeleteUserRemovesTokensTest() Assert.Null(await userMgr.GetAuthenticationTokenAsync(user, "provider", "test")); } - [ConditionalFact] public void CanCreateUserUsingEF() { diff --git a/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreWithGenericsTest.cs b/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreWithGenericsTest.cs index 94333d917ead..86f2c1ccd93b 100644 --- a/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreWithGenericsTest.cs +++ b/src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreWithGenericsTest.cs @@ -186,7 +186,6 @@ public int GetHashCode(Claim obj) } } - #region Generic Type defintions public class IdentityUserWithGenerics : IdentityUser diff --git a/src/Identity/Extensions.Core/src/IRoleStore.cs b/src/Identity/Extensions.Core/src/IRoleStore.cs index 381f6c57579a..3586afb2b328 100644 --- a/src/Identity/Extensions.Core/src/IRoleStore.cs +++ b/src/Identity/Extensions.Core/src/IRoleStore.cs @@ -79,7 +79,6 @@ public interface IRoleStore : IDisposable where TRole : class /// The that represents the asynchronous operation. Task SetNormalizedRoleNameAsync(TRole role, string normalizedName, CancellationToken cancellationToken); - /// /// Finds the role who has the specified ID as an asynchronous operation. /// diff --git a/src/Identity/Extensions.Core/src/IdentityBuilder.cs b/src/Identity/Extensions.Core/src/IdentityBuilder.cs index 3a422d35861d..3b4d6d7545a8 100644 --- a/src/Identity/Extensions.Core/src/IdentityBuilder.cs +++ b/src/Identity/Extensions.Core/src/IdentityBuilder.cs @@ -41,7 +41,6 @@ public IdentityBuilder(Type user, Type role, IServiceCollection services) : this /// public Type UserType { get; private set; } - /// /// Gets the used for roles. /// diff --git a/src/Identity/Extensions.Core/src/UserManager.cs b/src/Identity/Extensions.Core/src/UserManager.cs index 2cd6d43e3b90..feb77b4c3229 100644 --- a/src/Identity/Extensions.Core/src/UserManager.cs +++ b/src/Identity/Extensions.Core/src/UserManager.cs @@ -792,7 +792,6 @@ public virtual async Task ChangePasswordAsync(TUser user, string throw new ArgumentNullException(nameof(user)); } - if (await VerifyPasswordAsync(passwordStore, user, currentPassword) != PasswordVerificationResult.Failed) { var result = await UpdatePasswordHash(passwordStore, user, newPassword); diff --git a/src/Identity/Extensions.Stores/src/UserStoreBase.cs b/src/Identity/Extensions.Stores/src/UserStoreBase.cs index a9987d274b98..05eab3224c49 100644 --- a/src/Identity/Extensions.Stores/src/UserStoreBase.cs +++ b/src/Identity/Extensions.Stores/src/UserStoreBase.cs @@ -1117,7 +1117,6 @@ protected virtual TUserRole CreateUserRole(TUser user, TRole role) }; } - /// /// Retrieves all users in the specified role. /// diff --git a/src/Identity/samples/IdentitySample.DefaultUI/Startup.cs b/src/Identity/samples/IdentitySample.DefaultUI/Startup.cs index 516dbf8a4970..dc48228d2131 100644 --- a/src/Identity/samples/IdentitySample.DefaultUI/Startup.cs +++ b/src/Identity/samples/IdentitySample.DefaultUI/Startup.cs @@ -49,7 +49,6 @@ public void ConfigureServices(IServiceCollection services) services.AddDatabaseDeveloperPageExceptionFilter(); } - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { diff --git a/src/Identity/samples/IdentitySample.Mvc/Controllers/AccountController.cs b/src/Identity/samples/IdentitySample.Mvc/Controllers/AccountController.cs index 3e2298b05043..8e80d48b1d8c 100644 --- a/src/Identity/samples/IdentitySample.Mvc/Controllers/AccountController.cs +++ b/src/Identity/samples/IdentitySample.Mvc/Controllers/AccountController.cs @@ -532,7 +532,6 @@ public async Task UseRecoveryCode(UseRecoveryCodeViewModel model) } } - #region Helpers private void AddErrors(IdentityResult result) diff --git a/src/Identity/test/Identity.FunctionalTests/Properties/AssemblyInfo.cs b/src/Identity/test/Identity.FunctionalTests/Properties/AssemblyInfo.cs index 5a047bdbad8b..7fa686db35c1 100644 --- a/src/Identity/test/Identity.FunctionalTests/Properties/AssemblyInfo.cs +++ b/src/Identity/test/Identity.FunctionalTests/Properties/AssemblyInfo.cs @@ -1,6 +1,5 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - // Caused OOM test issues with file watcher. See https://github.com/aspnet/Identity/issues/1926 [assembly: CollectionBehavior(DisableTestParallelization = true)] diff --git a/src/Identity/test/Identity.FunctionalTests/UserStories.cs b/src/Identity/test/Identity.FunctionalTests/UserStories.cs index c0b1ada26ce4..b6e2641ac992 100644 --- a/src/Identity/test/Identity.FunctionalTests/UserStories.cs +++ b/src/Identity/test/Identity.FunctionalTests/UserStories.cs @@ -35,7 +35,6 @@ internal static async Task RegisterNewUserAsyncWithConfirm return await register.SubmitRegisterFormWithConfirmation(userName, password, hasRealEmailSender); } - internal static async Task LoginExistingUserAsync(HttpClient client, string userName, string password) { var index = await Index.CreateAsync(client); diff --git a/src/Identity/test/Identity.Test/Base32Test.cs b/src/Identity/test/Identity.Test/Base32Test.cs index a31b9dd82f03..8686193c2b9c 100644 --- a/src/Identity/test/Identity.Test/Base32Test.cs +++ b/src/Identity/test/Identity.Test/Base32Test.cs @@ -26,7 +26,6 @@ public void ConversionTest() Assert.Equal(data, Base32.FromBase32(Base32.ToBase32(data))); } - private static readonly RandomNumberGenerator _rng = RandomNumberGenerator.Create(); private static byte[] GetRandomByteArray(int length) diff --git a/src/Identity/test/Identity.Test/IdentityBuilderTest.cs b/src/Identity/test/Identity.Test/IdentityBuilderTest.cs index 67259d9e3f0d..9b811d355ec6 100644 --- a/src/Identity/test/Identity.Test/IdentityBuilderTest.cs +++ b/src/Identity/test/Identity.Test/IdentityBuilderTest.cs @@ -38,7 +38,6 @@ public void AddRolesWithoutStoreWillError() Assert.Throws(() => sp.GetService>()); } - [Fact] public void CanOverrideUserStore() { diff --git a/src/Identity/test/Identity.Test/PasswordValidatorTest.cs b/src/Identity/test/Identity.Test/PasswordValidatorTest.cs index aa9be5529065..05a04ea6cffb 100644 --- a/src/Identity/test/Identity.Test/PasswordValidatorTest.cs +++ b/src/Identity/test/Identity.Test/PasswordValidatorTest.cs @@ -28,7 +28,6 @@ public async Task ValidateThrowsWithNullTest() await Assert.ThrowsAsync("manager", () => validator.ValidateAsync(null, null, "foo")); } - [Theory] [InlineData("")] [InlineData("abc")] diff --git a/src/Identity/test/Identity.Test/SignInManagerTest.cs b/src/Identity/test/Identity.Test/SignInManagerTest.cs index adbaf0bb0428..147c16e31de1 100644 --- a/src/Identity/test/Identity.Test/SignInManagerTest.cs +++ b/src/Identity/test/Identity.Test/SignInManagerTest.cs @@ -160,7 +160,6 @@ public async Task CanPasswordSignInWithNoLogger() auth.Verify(); } - [Fact] public async Task PasswordSignInWorksWithNonTwoFactorStore() { @@ -645,7 +644,6 @@ public async Task RememberClientStoresUserId() && i.Identities.First().AuthenticationType == IdentityConstants.TwoFactorRememberMeScheme), It.Is(v => v.IsPersistent == true))).Returns(Task.FromResult(0)).Verifiable(); - // Act await helper.RememberTwoFactorClientAsync(user); diff --git a/src/Identity/test/Identity.Test/UserManagerTest.cs b/src/Identity/test/Identity.Test/UserManagerTest.cs index 57d98b2afc1e..f7017df33ef1 100644 --- a/src/Identity/test/Identity.Test/UserManagerTest.cs +++ b/src/Identity/test/Identity.Test/UserManagerTest.cs @@ -626,8 +626,6 @@ public async Task UpdateFailsWithNullSecurityStamp() store.VerifyAll(); } - - [Fact] public async Task RemoveClaimsCallsStore() { diff --git a/src/Identity/test/InMemory.Test/InMemoryUserStore.cs b/src/Identity/test/InMemory.Test/InMemoryUserStore.cs index a06fa33db228..13b37530e8e6 100644 --- a/src/Identity/test/InMemory.Test/InMemoryUserStore.cs +++ b/src/Identity/test/InMemory.Test/InMemoryUserStore.cs @@ -93,7 +93,6 @@ public IQueryable Users return Task.FromResult(0); } - public Task GetEmailConfirmedAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken)) { return Task.FromResult(user.EmailConfirmed); diff --git a/src/Localization/Localization/test/Microsoft.Extensions.Localization.Tests/ResourceManagerStringLocalizerTest.cs b/src/Localization/Localization/test/Microsoft.Extensions.Localization.Tests/ResourceManagerStringLocalizerTest.cs index 1ae5220362a1..6ceba2d6f5f6 100644 --- a/src/Localization/Localization/test/Microsoft.Extensions.Localization.Tests/ResourceManagerStringLocalizerTest.cs +++ b/src/Localization/Localization/test/Microsoft.Extensions.Localization.Tests/ResourceManagerStringLocalizerTest.cs @@ -237,7 +237,6 @@ private static int GetCultureInfoDepth(CultureInfo culture) return result; } - private TestSink Sink { get; } = new TestSink(); private ILogger Logger => new TestLoggerFactory(Sink, enabled: true).CreateLogger(); diff --git a/src/Logging.AzureAppServices/src/Properties/AssemblyInfo.cs b/src/Logging.AzureAppServices/src/Properties/AssemblyInfo.cs index 57e7258920dd..9c7898e3fbc9 100644 --- a/src/Logging.AzureAppServices/src/Properties/AssemblyInfo.cs +++ b/src/Logging.AzureAppServices/src/Properties/AssemblyInfo.cs @@ -3,5 +3,4 @@ using System.Runtime.CompilerServices; - [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] diff --git a/src/Middleware/CORS/src/Infrastructure/ICorsService.cs b/src/Middleware/CORS/src/Infrastructure/ICorsService.cs index dfd61478ef03..0713f30365dc 100644 --- a/src/Middleware/CORS/src/Infrastructure/ICorsService.cs +++ b/src/Middleware/CORS/src/Infrastructure/ICorsService.cs @@ -19,7 +19,6 @@ public interface ICorsService /// used by the caller to set appropriate response headers. CorsResult EvaluatePolicy(HttpContext context, CorsPolicy policy); - /// /// Adds CORS-specific response headers to the given . /// diff --git a/src/Middleware/CORS/test/UnitTests/CorsServiceTests.cs b/src/Middleware/CORS/test/UnitTests/CorsServiceTests.cs index 6458d14fc7a0..01aa3c37d190 100644 --- a/src/Middleware/CORS/test/UnitTests/CorsServiceTests.cs +++ b/src/Middleware/CORS/test/UnitTests/CorsServiceTests.cs @@ -776,7 +776,6 @@ public void ApplyResult_OneAllowHeaders_AllowHeadersHeaderAdded() Assert.Equal("foo", httpContext.Response.Headers["Access-Control-Allow-Headers"]); } - [Fact] public void ApplyResult_NoAllowExposedHeaders_ExposedHeadersHeaderNotAdded() { @@ -839,7 +838,6 @@ public void ApplyResult_NoPreflightRequest_ExposesHeadersAdded() Assert.Equal("foo,bar", httpContext.Response.Headers[CorsConstants.AccessControlExposeHeaders]); } - [Fact] public void ApplyResult_OneAllowExposedHeaders_ExposedHeadersHeaderAdded() { diff --git a/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/DatabaseErrorPageMiddlewareTest.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/DatabaseErrorPageMiddlewareTest.cs index c1ae43446c02..077e84d13dd6 100644 --- a/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/DatabaseErrorPageMiddlewareTest.cs +++ b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/DatabaseErrorPageMiddlewareTest.cs @@ -393,7 +393,6 @@ public async Task Pass_thru_when_context_not_in_services() await host.StartAsync(); - try { using var server = host.GetTestServer(); diff --git a/src/Middleware/Diagnostics/test/FunctionalTests/DeveloperExceptionPageSampleTest.cs b/src/Middleware/Diagnostics/test/FunctionalTests/DeveloperExceptionPageSampleTest.cs index f2771c6d79ad..7691e4a9c005 100644 --- a/src/Middleware/Diagnostics/test/FunctionalTests/DeveloperExceptionPageSampleTest.cs +++ b/src/Middleware/Diagnostics/test/FunctionalTests/DeveloperExceptionPageSampleTest.cs @@ -15,7 +15,6 @@ public DeveloperExceptionPageSampleTest(TestFixture w.Message.Contains("Body: test")); } - [Fact] public async Task StatusCodeLogs() { diff --git a/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs b/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs index b12008ca31bb..ffe1c08a70f4 100644 --- a/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs +++ b/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs @@ -29,7 +29,6 @@ public void Ctor_ThrowsExceptionsWhenNullArgs() null, new TestW3CLogger(options, new HostingEnvironment(), NullLoggerFactory.Instance))); - Assert.Throws(() => new W3CLoggingMiddleware(c => { return Task.CompletedTask; diff --git a/src/Middleware/HttpOverrides/test/HttpMethodOverrideMiddlewareTest.cs b/src/Middleware/HttpOverrides/test/HttpMethodOverrideMiddlewareTest.cs index 64fc998c0760..937d04a58253 100644 --- a/src/Middleware/HttpOverrides/test/HttpMethodOverrideMiddlewareTest.cs +++ b/src/Middleware/HttpOverrides/test/HttpMethodOverrideMiddlewareTest.cs @@ -102,7 +102,6 @@ public async Task XHttpMethodOverrideFromGetRequestDoesntChangeMethodType() Assert.True(assertsExecuted); } - [Fact] public async Task FormFieldAvailableChangesRequestMethod() { @@ -137,7 +136,6 @@ public async Task FormFieldAvailableChangesRequestMethod() { "_METHOD", "DELETE" } }); - await server.CreateClient().SendAsync(req); Assert.True(assertsExecuted); } @@ -175,7 +173,6 @@ public async Task FormFieldUnavailableDoesNotChangeRequestMethod() { }); - await server.CreateClient().SendAsync(req); Assert.True(assertsExecuted); } @@ -214,7 +211,6 @@ public async Task FormFieldEmptyDoesNotChangeRequestMethod() { "_METHOD", "" } }); - await server.CreateClient().SendAsync(req); Assert.True(assertsExecuted); } diff --git a/src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs b/src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs index 73d7cc1a625f..24d0e9bab3b1 100644 --- a/src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs +++ b/src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs @@ -256,7 +256,6 @@ internal async Task TryServeFromCacheAsync(ResponseCachingContext context) return false; } - /// /// Finalize cache headers. /// diff --git a/src/Middleware/ResponseCaching/test/ResponseCachingFeatureTests.cs b/src/Middleware/ResponseCaching/test/ResponseCachingFeatureTests.cs index 130a107e873e..ba40bc233064 100644 --- a/src/Middleware/ResponseCaching/test/ResponseCachingFeatureTests.cs +++ b/src/Middleware/ResponseCaching/test/ResponseCachingFeatureTests.cs @@ -44,7 +44,6 @@ public static TheoryData InvalidVaryRules } } - [Theory] [MemberData(nameof(InvalidVaryRules))] public void VaryByQueryKeys_Set_InValidEmptyValues_Throws(string[] value) diff --git a/src/Middleware/ResponseCaching/test/SegmentWriteStreamTests.cs b/src/Middleware/ResponseCaching/test/SegmentWriteStreamTests.cs index 6bd93f0dba31..88aa33d87b57 100644 --- a/src/Middleware/ResponseCaching/test/SegmentWriteStreamTests.cs +++ b/src/Middleware/ResponseCaching/test/SegmentWriteStreamTests.cs @@ -79,7 +79,6 @@ public void Write_CanWriteAllBytes(int writeSize) var segmentSize = 5; var stream = new SegmentWriteStream(segmentSize); - for (var i = 0; i < WriteData.Length; i += writeSize) { stream.Write(WriteData, i, Math.Min(writeSize, WriteData.Length - i)); diff --git a/src/Middleware/ResponseCompression/src/ResponseCompressionMiddleware.cs b/src/Middleware/ResponseCompression/src/ResponseCompressionMiddleware.cs index ab26c2102c97..25f90ef6285b 100644 --- a/src/Middleware/ResponseCompression/src/ResponseCompressionMiddleware.cs +++ b/src/Middleware/ResponseCompression/src/ResponseCompressionMiddleware.cs @@ -13,10 +13,8 @@ namespace Microsoft.AspNetCore.ResponseCompression; public class ResponseCompressionMiddleware { private readonly RequestDelegate _next; - private readonly IResponseCompressionProvider _provider; - /// /// Initialize the Response Compression middleware. /// diff --git a/src/Middleware/ResponseCompression/test/ResponseCompressionBodyTest.cs b/src/Middleware/ResponseCompression/test/ResponseCompressionBodyTest.cs index d5f9a2d7cd40..0999ddd07b8e 100644 --- a/src/Middleware/ResponseCompression/test/ResponseCompressionBodyTest.cs +++ b/src/Middleware/ResponseCompression/test/ResponseCompressionBodyTest.cs @@ -22,7 +22,6 @@ public void OnWrite_AppendsAcceptEncodingToVaryHeader_IfNotPresent(string provid stream.Write(new byte[] { }, 0, 0); - Assert.Equal(expectedVaryHeader, httpContext.Response.Headers.Vary); } @@ -116,7 +115,6 @@ public bool CheckRequestAcceptsCompression(HttpContext context) } } - private class MockCompressionProvider : ICompressionProvider { public MockCompressionProvider(bool flushable) diff --git a/src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs b/src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs index ce057132a970..456076237a69 100644 --- a/src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs +++ b/src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs @@ -411,7 +411,6 @@ public async Task Response_WithContentRange_NotCompressed() AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, "Response compression disabled due to the Content-Range header."); } - [Fact] public async Task Response_WithContentEncodingAlreadySet_NotReCompressed() { diff --git a/src/Middleware/Rewrite/src/RedirectRule.cs b/src/Middleware/Rewrite/src/RedirectRule.cs index 7f9e36f9675f..52746859b921 100644 --- a/src/Middleware/Rewrite/src/RedirectRule.cs +++ b/src/Middleware/Rewrite/src/RedirectRule.cs @@ -47,7 +47,6 @@ public virtual void ApplyRule(RewriteContext context) initMatchResults = InitialMatch.Match(path.ToString().Substring(1)); } - if (initMatchResults.Success) { var newPath = initMatchResults.Result(Replacement); diff --git a/src/Middleware/Rewrite/src/UrlActions/RewriteAction.cs b/src/Middleware/Rewrite/src/UrlActions/RewriteAction.cs index 496a82610f04..9673d6e5f6f3 100644 --- a/src/Middleware/Rewrite/src/UrlActions/RewriteAction.cs +++ b/src/Middleware/Rewrite/src/UrlActions/RewriteAction.cs @@ -58,7 +58,6 @@ public override void ApplyAction(RewriteContext context, BackReferenceCollection pattern = Uri.EscapeDataString(pattern); } - // TODO PERF, substrings, object creation, etc. if (pattern.IndexOf(Uri.SchemeDelimiter, StringComparison.Ordinal) >= 0) { diff --git a/src/Middleware/Rewrite/test/PatternSegments/IsHttpsModSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/IsHttpsModSegmentTests.cs index 5203b76b04ab..e729c07989bc 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/IsHttpsModSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/IsHttpsModSegmentTests.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Rewrite.PatternSegments; diff --git a/src/Middleware/Rewrite/test/PatternSegments/IsHttpsSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/IsHttpsSegmentTests.cs index 0de9692ff8b4..80200906ece9 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/IsHttpsSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/IsHttpsSegmentTests.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Rewrite.PatternSegments; diff --git a/src/Middleware/Rewrite/test/PatternSegments/IsIPV6SegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/IsIPV6SegmentTests.cs index 83a6aae698e0..fa1bfc25cc1b 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/IsIPV6SegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/IsIPV6SegmentTests.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Net; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Rewrite.PatternSegments; diff --git a/src/Middleware/Rewrite/test/PatternSegments/LocalAddressSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/LocalAddressSegmentTests.cs index 964dcf0f877a..4edc5d567306 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/LocalAddressSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/LocalAddressSegmentTests.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Net; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Rewrite.PatternSegments; diff --git a/src/Middleware/Rewrite/test/PatternSegments/LocalPortSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/LocalPortSegmentTests.cs index 9caa8d1d2594..ebb887479abb 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/LocalPortSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/LocalPortSegmentTests.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Rewrite.PatternSegments; diff --git a/src/Middleware/Rewrite/test/UrlActions/ChangeCookieActionTests.cs b/src/Middleware/Rewrite/test/UrlActions/ChangeCookieActionTests.cs index 44aac9d3f626..a04a190d7935 100644 --- a/src/Middleware/Rewrite/test/UrlActions/ChangeCookieActionTests.cs +++ b/src/Middleware/Rewrite/test/UrlActions/ChangeCookieActionTests.cs @@ -47,7 +47,6 @@ public void ZeroLifetime() Assert.Equal($"Cookie=Chocolate%20Chip", header); } - [Fact] public void UnsetCookie() { diff --git a/src/Middleware/StaticFiles/test/UnitTests/CacheHeaderTests.cs b/src/Middleware/StaticFiles/test/UnitTests/CacheHeaderTests.cs index 8717ddfdc06c..5486991649f6 100644 --- a/src/Middleware/StaticFiles/test/UnitTests/CacheHeaderTests.cs +++ b/src/Middleware/StaticFiles/test/UnitTests/CacheHeaderTests.cs @@ -200,7 +200,6 @@ public async Task MatchingBothConditionsReturnsNotModified(HttpMethod method) Assert.Equal(HttpStatusCode.NotModified, resp2.StatusCode); } - [Theory] [MemberData(nameof(SupportedMethods))] public async Task MatchingAtLeastOneETagReturnsNotModified(HttpMethod method) @@ -428,7 +427,6 @@ public async Task IfUnmodifiedSinceDateLessThanLastModifiedShouldReturn412(HttpM Assert.Equal(HttpStatusCode.PreconditionFailed, res2.StatusCode); } - public static IEnumerable SupportedMethods => new[] { new [] { HttpMethod.Get }, diff --git a/src/Middleware/WebSockets/test/ConformanceTests/AutobahnTests.cs b/src/Middleware/WebSockets/test/ConformanceTests/AutobahnTests.cs index f420154b764a..ec8688a06174 100644 --- a/src/Middleware/WebSockets/test/ConformanceTests/AutobahnTests.cs +++ b/src/Middleware/WebSockets/test/ConformanceTests/AutobahnTests.cs @@ -80,7 +80,6 @@ public async Task AutobahnTestSuite() private bool IsWindows8OrHigher() => OperatingSystem.IsWindowsVersionAtLeast(6, 2); - private bool IsIISExpress10Installed() { var pf = Environment.GetEnvironmentVariable("PROGRAMFILES"); diff --git a/src/Middleware/WebSockets/test/UnitTests/DuplexStream.cs b/src/Middleware/WebSockets/test/UnitTests/DuplexStream.cs index e594b6385c9b..b8d4b8ae917f 100644 --- a/src/Middleware/WebSockets/test/UnitTests/DuplexStream.cs +++ b/src/Middleware/WebSockets/test/UnitTests/DuplexStream.cs @@ -25,7 +25,6 @@ public DuplexStream CreateReverseDuplexStream() return new DuplexStream(WriteStream, ReadStream); } - #region Properties public override bool CanRead diff --git a/src/Mvc/Mvc.Abstractions/src/Filters/ActionExecutingContext.cs b/src/Mvc/Mvc.Abstractions/src/Filters/ActionExecutingContext.cs index 59678c89c9c7..f8f6723fc5fe 100644 --- a/src/Mvc/Mvc.Abstractions/src/Filters/ActionExecutingContext.cs +++ b/src/Mvc/Mvc.Abstractions/src/Filters/ActionExecutingContext.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.Filters; /// diff --git a/src/Mvc/Mvc.Abstractions/src/Filters/FilterDescriptor.cs b/src/Mvc/Mvc.Abstractions/src/Filters/FilterDescriptor.cs index 0a0b04c7e769..e9259fe9389c 100644 --- a/src/Mvc/Mvc.Abstractions/src/Filters/FilterDescriptor.cs +++ b/src/Mvc/Mvc.Abstractions/src/Filters/FilterDescriptor.cs @@ -44,7 +44,6 @@ public FilterDescriptor(IFilterMetadata filter, int filterScope) Filter = filter; Scope = filterScope; - if (Filter is IOrderedFilter orderedFilter) { Order = orderedFilter.Order; diff --git a/src/Mvc/Mvc.Abstractions/test/Filters/FilterContextTest.cs b/src/Mvc/Mvc.Abstractions/test/Filters/FilterContextTest.cs index 379c37fd2603..0367f57d6f53 100644 --- a/src/Mvc/Mvc.Abstractions/test/Filters/FilterContextTest.cs +++ b/src/Mvc/Mvc.Abstractions/test/Filters/FilterContextTest.cs @@ -69,7 +69,6 @@ public void IsEffectivePolicy_NoMatch_ReturnsFalse() Assert.False(result); } - [Fact] public void FindEffectivePolicy_FindsLastFilter_ReturnsIt() { diff --git a/src/Mvc/Mvc.Analyzers/test/AvoidHtmlPartialAnalyzerTest.cs b/src/Mvc/Mvc.Analyzers/test/AvoidHtmlPartialAnalyzerTest.cs index 429c6907a149..142a2a01801c 100644 --- a/src/Mvc/Mvc.Analyzers/test/AvoidHtmlPartialAnalyzerTest.cs +++ b/src/Mvc/Mvc.Analyzers/test/AvoidHtmlPartialAnalyzerTest.cs @@ -92,7 +92,6 @@ public class NoDiagnosticsAreReturned_ForUseOfHtmlPartialAsync : global::Microso } #pragma warning restore 1591"; - return VerifyAnalyzerAsync(source, DiagnosticResult.EmptyDiagnosticResults); } diff --git a/src/Mvc/Mvc.Analyzers/test/CodeAnalysisExtensionsTest.cs b/src/Mvc/Mvc.Analyzers/test/CodeAnalysisExtensionsTest.cs index fb53c7a39509..e8beabd8bf11 100644 --- a/src/Mvc/Mvc.Analyzers/test/CodeAnalysisExtensionsTest.cs +++ b/src/Mvc/Mvc.Analyzers/test/CodeAnalysisExtensionsTest.cs @@ -165,7 +165,6 @@ public override void Method() { } var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); var method = (IMethodSymbol)testClass.GetMembers("Method").First(); - // Act var attributes = CodeAnalysisExtensions.GetAttributes(method, attribute, inherit: true); diff --git a/src/Mvc/Mvc.Analyzers/test/TagHelpersInCodeBlocksAnalyzerTest.cs b/src/Mvc/Mvc.Analyzers/test/TagHelpersInCodeBlocksAnalyzerTest.cs index 7332c9bc1a6e..c47fadb7b721 100644 --- a/src/Mvc/Mvc.Analyzers/test/TagHelpersInCodeBlocksAnalyzerTest.cs +++ b/src/Mvc/Mvc.Analyzers/test/TagHelpersInCodeBlocksAnalyzerTest.cs @@ -111,7 +111,6 @@ public class DiagnosticsAreReturned_ForUseOfTagHelpersInActions : global::Micros return VerifyAnalyzerAsync(source, diagnosticResult, CS4034Result.WithLocation(1), CS4034Result.WithLocation(2)); } - [Fact] public Task DiagnosticsAreReturned_ForUseOfTagHelpersInNonAsyncFunc() { @@ -887,7 +886,6 @@ public class SingleDiagnosticIsReturned_ForMultipleTagHelpersInVoidMethod : glob var diagnosticResult = new DiagnosticResult(DiagnosticDescriptor) .WithLocation(0); - return VerifyAnalyzerAsync(source, diagnosticResult, CS4033Result.WithLocation(1), diff --git a/src/Mvc/Mvc.Api.Analyzers/test/MvcFactsTest.cs b/src/Mvc/Mvc.Api.Analyzers/test/MvcFactsTest.cs index efdb12bdea38..2d9ec774b66e 100644 --- a/src/Mvc/Mvc.Api.Analyzers/test/MvcFactsTest.cs +++ b/src/Mvc/Mvc.Api.Analyzers/test/MvcFactsTest.cs @@ -213,7 +213,6 @@ private IMethodSymbol GetDisposableDispose(Compilation compilation) } #endregion - private Task GetIsControllerCompilation() => GetCompilation("IsControllerTests"); private Task GetIsControllerActionCompilation() => GetCompilation("IsControllerActionTests"); diff --git a/src/Mvc/Mvc.Api.Analyzers/test/SymbolApiConventionMatcherTest.cs b/src/Mvc/Mvc.Api.Analyzers/test/SymbolApiConventionMatcherTest.cs index e15f629ecfc9..52124eb87b90 100644 --- a/src/Mvc/Mvc.Api.Analyzers/test/SymbolApiConventionMatcherTest.cs +++ b/src/Mvc/Mvc.Api.Analyzers/test/SymbolApiConventionMatcherTest.cs @@ -306,7 +306,6 @@ public async Task IsTypeMatch_WithAssignableFrom_ReturnsTrueForDerived() var type = compilation.GetTypeByMetadataName(DerivedTypeName); var conventionType = compilation.GetTypeByMetadataName(BaseTypeName); - // Act var result = IsTypeMatch(type, conventionType, SymbolApiConventionTypeMatchBehavior.AssignableFrom); diff --git a/src/Mvc/Mvc.ApiExplorer/src/ApiResponseTypeProvider.cs b/src/Mvc/Mvc.ApiExplorer/src/ApiResponseTypeProvider.cs index 1d0a4cb65c2a..0c58956eccce 100644 --- a/src/Mvc/Mvc.ApiExplorer/src/ApiResponseTypeProvider.cs +++ b/src/Mvc/Mvc.ApiExplorer/src/ApiResponseTypeProvider.cs @@ -255,8 +255,6 @@ internal static void CalculateResponseFormatForType(ApiResponseType apiResponse, } } - - if (!isSupportedContentType && contentType != null) { // No output formatter was found that supports this content type. Add the user specified content type as-is to the result. diff --git a/src/Mvc/Mvc.ApiExplorer/test/DefaultApiDescriptionProviderTest.cs b/src/Mvc/Mvc.ApiExplorer/test/DefaultApiDescriptionProviderTest.cs index d080ae410817..4c474c953877 100644 --- a/src/Mvc/Mvc.ApiExplorer/test/DefaultApiDescriptionProviderTest.cs +++ b/src/Mvc/Mvc.ApiExplorer/test/DefaultApiDescriptionProviderTest.cs @@ -128,7 +128,6 @@ public void GetApiDescription_HttpMethodIsNullWithoutConstraint() Assert.Null(description.HttpMethod); } - [Fact] public void GetApiDescription_CreatesMultipleDescriptionsForMultipleHttpMethods() { diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/ApplicationModelFactory.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/ApplicationModelFactory.cs index f222e428e1fa..3b38d0eda507 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/ApplicationModelFactory.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/ApplicationModelFactory.cs @@ -122,7 +122,6 @@ public static List Flatten( throw new InvalidOperationException(message); } - return results; } diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/ClientErrorResultFilterConvention.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/ClientErrorResultFilterConvention.cs index a95fbb0a54bf..34ce2ba5aec9 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/ClientErrorResultFilterConvention.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/ClientErrorResultFilterConvention.cs @@ -27,7 +27,6 @@ public void Apply(ActionModel action) return; } - action.Filters.Add(_filterFactory); } diff --git a/src/Mvc/Mvc.Core/src/ControllerBase.cs b/src/Mvc/Mvc.Core/src/ControllerBase.cs index bbe04cc9c32a..b761b694ea66 100644 --- a/src/Mvc/Mvc.Core/src/ControllerBase.cs +++ b/src/Mvc/Mvc.Core/src/ControllerBase.cs @@ -1942,7 +1942,6 @@ public virtual ActionResult ValidationProblem([ActionResultObjectValue] Validati public virtual ActionResult ValidationProblem([ActionResultObjectValue] ModelStateDictionary modelStateDictionary) => ValidationProblem(detail: null, modelStateDictionary: modelStateDictionary); - /// /// Creates an that produces a response /// with validation errors from . diff --git a/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs b/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs index 7841f4ad9cbb..0109a6fbbe0d 100644 --- a/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs +++ b/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs @@ -439,7 +439,6 @@ public BeforeResourceFilterOnResourceExecutedEventData(ActionDescriptor actionDe Filter = filter; } - /// /// The action. /// diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultObjectValueAttribute.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultObjectValueAttribute.cs index c18051a3dfed..fbbf8eb92e17 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultObjectValueAttribute.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultObjectValueAttribute.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.Infrastructure; /// diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultStatusCodeAttribute.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultStatusCodeAttribute.cs index 2c40b74dbec2..b3a945c199d2 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultStatusCodeAttribute.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultStatusCodeAttribute.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.Infrastructure; /// diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultTypeMapper.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultTypeMapper.cs index aa512f4376ce..97645af4704e 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultTypeMapper.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ActionResultTypeMapper.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.Infrastructure; internal class ActionResultTypeMapper : IActionResultTypeMapper diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/DefaultStatusCodeAttribute.cs b/src/Mvc/Mvc.Core/src/Infrastructure/DefaultStatusCodeAttribute.cs index 74c550dd9dc5..a52c0789a3ac 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/DefaultStatusCodeAttribute.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/DefaultStatusCodeAttribute.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.Infrastructure; /// diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/IActionResultTypeMapper.cs b/src/Mvc/Mvc.Core/src/Infrastructure/IActionResultTypeMapper.cs index 97a5a28923a2..b80f54f5c4b1 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/IActionResultTypeMapper.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/IActionResultTypeMapper.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.Infrastructure; /// diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ITypeActivatorCache.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ITypeActivatorCache.cs index 06821bf8bb33..cc8d56bf3f3b 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ITypeActivatorCache.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ITypeActivatorCache.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.Infrastructure; /// diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/NonDisposableStream.cs b/src/Mvc/Mvc.Core/src/Infrastructure/NonDisposableStream.cs index fb2c27d93096..5c0083226ce4 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/NonDisposableStream.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/NonDisposableStream.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.Infrastructure; /// diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ObjectResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ObjectResultExecutor.cs index d335ca73db93..4ffcb0662986 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ObjectResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ObjectResultExecutor.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics; using System.Text; using Microsoft.AspNetCore.Http; diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/OrderedEndpointsSequenceProviderCache.cs b/src/Mvc/Mvc.Core/src/Infrastructure/OrderedEndpointsSequenceProviderCache.cs index 29c22ec98db2..65463e126e75 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/OrderedEndpointsSequenceProviderCache.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/OrderedEndpointsSequenceProviderCache.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Collections.Concurrent; using Microsoft.AspNetCore.Routing; diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/OutputFormatterSelector.cs b/src/Mvc/Mvc.Core/src/Infrastructure/OutputFormatterSelector.cs index 9f4806b6540d..020c3f21ad85 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/OutputFormatterSelector.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/OutputFormatterSelector.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Mvc.Formatters; namespace Microsoft.AspNetCore.Mvc.Infrastructure; diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ParameterDefaultValues.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ParameterDefaultValues.cs index a62307e5d328..0aecf41a0f4d 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ParameterDefaultValues.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ParameterDefaultValues.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.ComponentModel; using System.Reflection; using Microsoft.Extensions.Internal; diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/PhysicalFileResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/PhysicalFileResultExecutor.cs index e377cb86f3dd..887ff1be3a38 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/PhysicalFileResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/PhysicalFileResultExecutor.cs @@ -132,7 +132,6 @@ protected virtual Stream GetFileStream(string path) FileOptions.Asynchronous | FileOptions.SequentialScan); } - /// /// Get the file metadata for a path. /// diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ProblemDetailsFactory.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ProblemDetailsFactory.cs index 83fe99be52b3..b014611f50c9 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ProblemDetailsFactory.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ProblemDetailsFactory.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.ModelBinding; diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ResourceInvoker.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ResourceInvoker.cs index ae30ee19f9b4..d279ccb1b012 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ResourceInvoker.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ResourceInvoker.cs @@ -1435,7 +1435,6 @@ static async Task Throw() #pragma warning restore CS1998 } - private static void Rethrow(ResourceExecutedContextSealed context) { if (context == null) diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/SystemTextJsonResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/SystemTextJsonResultExecutor.cs index 987fb9515b5f..a03d2bae6db3 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/SystemTextJsonResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/SystemTextJsonResultExecutor.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Runtime.ExceptionServices; using System.Text; using System.Text.Json; diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/TypeActivatorCache.cs b/src/Mvc/Mvc.Core/src/Infrastructure/TypeActivatorCache.cs index 98ec9f4c758b..88d2f1d2a1ab 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/TypeActivatorCache.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/TypeActivatorCache.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Collections.Concurrent; using Microsoft.Extensions.DependencyInjection; diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ValidationProblemDetailsJsonConverter.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ValidationProblemDetailsJsonConverter.cs index 01a946e741ee..442ecffdb5d1 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ValidationProblemDetailsJsonConverter.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ValidationProblemDetailsJsonConverter.cs @@ -16,7 +16,6 @@ public override ValidationProblemDetails Read(ref Utf8JsonReader reader, Type ty return problemDetails; } - public override void Write(Utf8JsonWriter writer, ValidationProblemDetails value, JsonSerializerOptions options) { HttpValidationProblemDetailsJsonConverter.WriteProblemDetails(writer, value, options); diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/BindNeverAttribute.cs b/src/Mvc/Mvc.Core/src/ModelBinding/BindNeverAttribute.cs index 68d61f10fb63..7800e1529b40 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/BindNeverAttribute.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/BindNeverAttribute.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/BindRequiredAttribute.cs b/src/Mvc/Mvc.Core/src/ModelBinding/BindRequiredAttribute.cs index f1952d805b1d..d52bbbf0a00e 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/BindRequiredAttribute.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/BindRequiredAttribute.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/BinderTypeModelBinderProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/BinderTypeModelBinderProvider.cs index 49594a871b24..952b73238453 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/BinderTypeModelBinderProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/BinderTypeModelBinderProvider.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/CancellationTokenModelBinderProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/CancellationTokenModelBinderProvider.cs index 16c8d34f2069..7b473bce5e0c 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/CancellationTokenModelBinderProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/CancellationTokenModelBinderProvider.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ServicesModelBinderProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ServicesModelBinderProvider.cs index e72eb38e0cdd..b630c8adb951 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ServicesModelBinderProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ServicesModelBinderProvider.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/BindingBehaviorAttribute.cs b/src/Mvc/Mvc.Core/src/ModelBinding/BindingBehaviorAttribute.cs index 3c8d88cd9e81..7e63c309f3af 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/BindingBehaviorAttribute.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/BindingBehaviorAttribute.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/ICollectionModelBinder.cs b/src/Mvc/Mvc.Core/src/ModelBinding/ICollectionModelBinder.cs index 2dc1956bab19..8b828bf5e0a7 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/ICollectionModelBinder.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/ICollectionModelBinder.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/IEnumerableValueProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/IEnumerableValueProvider.cs index 70ce9f09960a..ebf6e176c78d 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/IEnumerableValueProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/IEnumerableValueProvider.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingMetadataProviderContext.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingMetadataProviderContext.cs index debd5831da86..8bc2991008d1 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingMetadataProviderContext.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingMetadataProviderContext.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingSourceMetadataProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingSourceMetadataProvider.cs index 683397c92427..7cd03bb9d6e9 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingSourceMetadataProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingSourceMetadataProvider.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; /// @@ -32,7 +31,6 @@ public BindingSourceMetadataProvider(Type type, BindingSource? bindingSource) BindingSource = bindingSource; } - /// /// The . The provider sets of the given or /// anything assignable to the given . diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultMetadataDetails.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultMetadataDetails.cs index dcde442669a0..6a3c5d34c8f8 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultMetadataDetails.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultMetadataDetails.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DisplayMetadata.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DisplayMetadata.cs index c209577c2f29..c9d6ef040cda 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DisplayMetadata.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DisplayMetadata.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DisplayMetadataProviderContext.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DisplayMetadataProviderContext.cs index 7b5a3222efd1..e422cfe6be83 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DisplayMetadataProviderContext.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DisplayMetadataProviderContext.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/ExcludeBindingMetadataProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/ExcludeBindingMetadataProvider.cs index feecc8cf7663..2dc639b2d580 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/ExcludeBindingMetadataProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/ExcludeBindingMetadataProvider.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/MetadataDetailsProviderExtensions.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/MetadataDetailsProviderExtensions.cs index f20010ac8563..41a6bd715fa7 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/MetadataDetailsProviderExtensions.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/MetadataDetailsProviderExtensions.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/ValidationMetadataProviderContext.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/ValidationMetadataProviderContext.cs index d8cd32d62664..5bcc660d07f7 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/ValidationMetadataProviderContext.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/ValidationMetadataProviderContext.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/ModelBinderProviderExtensions.cs b/src/Mvc/Mvc.Core/src/ModelBinding/ModelBinderProviderExtensions.cs index 4b10a2959b2c..ea189aefc8d6 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/ModelBinderProviderExtensions.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/ModelBinderProviderExtensions.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/NoOpBinder.cs b/src/Mvc/Mvc.Core/src/ModelBinding/NoOpBinder.cs index 5445c6473a83..e7a288bf0a7f 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/NoOpBinder.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/NoOpBinder.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding; internal class NoOpBinder : IModelBinder diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/RouteValueProviderFactory.cs b/src/Mvc/Mvc.Core/src/ModelBinding/RouteValueProviderFactory.cs index f20ca574243e..0fc009d6cf34 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/RouteValueProviderFactory.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/RouteValueProviderFactory.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/UnsupportedContentTypeException.cs b/src/Mvc/Mvc.Core/src/ModelBinding/UnsupportedContentTypeException.cs index f7d29a880e31..0d0026c1d1f0 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/UnsupportedContentTypeException.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/UnsupportedContentTypeException.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/CompositeClientModelValidatorProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/CompositeClientModelValidatorProvider.cs index b7a5898852ba..100068396087 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/CompositeClientModelValidatorProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/CompositeClientModelValidatorProvider.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/CompositeModelValidatorProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/CompositeModelValidatorProvider.cs index 625701a8a6c3..af09a0083a60 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/CompositeModelValidatorProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/CompositeModelValidatorProvider.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/DefaultModelValidatorProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/DefaultModelValidatorProvider.cs index 50f398dab663..a6a76dfbdb54 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/DefaultModelValidatorProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/DefaultModelValidatorProvider.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/DefaultObjectValidator.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/DefaultObjectValidator.cs index 60db38b4ef32..daeffad70c23 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/DefaultObjectValidator.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/DefaultObjectValidator.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ModelValidatorProviderExtensions.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ModelValidatorProviderExtensions.cs index b877d01a4c98..8683600cb721 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ModelValidatorProviderExtensions.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ModelValidatorProviderExtensions.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidateNeverAttribute.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidateNeverAttribute.cs index d5234b7068e4..bfeb0f57f09a 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidateNeverAttribute.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidateNeverAttribute.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation; /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/ValueProviderFactoryExtensions.cs b/src/Mvc/Mvc.Core/src/ModelBinding/ValueProviderFactoryExtensions.cs index ffdabae737aa..36eaa36e4655 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/ValueProviderFactoryExtensions.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/ValueProviderFactoryExtensions.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ModelBinding; /// diff --git a/src/Mvc/Mvc.Core/src/Routing/ActionConstraintMatcherPolicy.cs b/src/Mvc/Mvc.Core/src/Routing/ActionConstraintMatcherPolicy.cs index 502a04031615..9cfa9661cef0 100644 --- a/src/Mvc/Mvc.Core/src/Routing/ActionConstraintMatcherPolicy.cs +++ b/src/Mvc/Mvc.Core/src/Routing/ActionConstraintMatcherPolicy.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Linq; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Abstractions; diff --git a/src/Mvc/Mvc.Core/src/Routing/ActionEndpointDataSourceBase.cs b/src/Mvc/Mvc.Core/src/Routing/ActionEndpointDataSourceBase.cs index ffa88c1f6817..9d04bc583a34 100644 --- a/src/Mvc/Mvc.Core/src/Routing/ActionEndpointDataSourceBase.cs +++ b/src/Mvc/Mvc.Core/src/Routing/ActionEndpointDataSourceBase.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; diff --git a/src/Mvc/Mvc.Core/src/Routing/ActionEndpointFactory.cs b/src/Mvc/Mvc.Core/src/Routing/ActionEndpointFactory.cs index f44609ca6457..2e13eb59382b 100644 --- a/src/Mvc/Mvc.Core/src/Routing/ActionEndpointFactory.cs +++ b/src/Mvc/Mvc.Core/src/Routing/ActionEndpointFactory.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Linq; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; diff --git a/src/Mvc/Mvc.Core/src/Routing/AttributeRoute.cs b/src/Mvc/Mvc.Core/src/Routing/AttributeRoute.cs index 9caac532e4fc..d14bc5f37d86 100644 --- a/src/Mvc/Mvc.Core/src/Routing/AttributeRoute.cs +++ b/src/Mvc/Mvc.Core/src/Routing/AttributeRoute.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Linq; using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Infrastructure; diff --git a/src/Mvc/Mvc.Core/src/Routing/AttributeRouting.cs b/src/Mvc/Mvc.Core/src/Routing/AttributeRouting.cs index 7f009cd1223d..bc55f0b9b787 100644 --- a/src/Mvc/Mvc.Core/src/Routing/AttributeRouting.cs +++ b/src/Mvc/Mvc.Core/src/Routing/AttributeRouting.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; diff --git a/src/Mvc/Mvc.Core/src/Routing/ControllerActionEndpointDataSource.cs b/src/Mvc/Mvc.Core/src/Routing/ControllerActionEndpointDataSource.cs index 8eda9b1fbecd..542e1da33f2c 100644 --- a/src/Mvc/Mvc.Core/src/Routing/ControllerActionEndpointDataSource.cs +++ b/src/Mvc/Mvc.Core/src/Routing/ControllerActionEndpointDataSource.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Abstractions; diff --git a/src/Mvc/Mvc.Core/src/Routing/ControllerActionEndpointDataSourceFactory.cs b/src/Mvc/Mvc.Core/src/Routing/ControllerActionEndpointDataSourceFactory.cs index 86f2904474ad..c397b2e964ed 100644 --- a/src/Mvc/Mvc.Core/src/Routing/ControllerActionEndpointDataSourceFactory.cs +++ b/src/Mvc/Mvc.Core/src/Routing/ControllerActionEndpointDataSourceFactory.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Mvc.Routing; namespace Microsoft.AspNetCore.Mvc.Infrastructure; diff --git a/src/Mvc/Mvc.Core/src/Routing/ControllerEndpointDataSourceIdMetadata.cs b/src/Mvc/Mvc.Core/src/Routing/ControllerEndpointDataSourceIdMetadata.cs index 8876dfa8c3b6..4e872ef0d74c 100644 --- a/src/Mvc/Mvc.Core/src/Routing/ControllerEndpointDataSourceIdMetadata.cs +++ b/src/Mvc/Mvc.Core/src/Routing/ControllerEndpointDataSourceIdMetadata.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - namespace Microsoft.AspNetCore.Mvc.Routing; internal class ControllerEndpointDataSourceIdMetadata diff --git a/src/Mvc/Mvc.Core/src/Routing/ControllerLinkGeneratorExtensions.cs b/src/Mvc/Mvc.Core/src/Routing/ControllerLinkGeneratorExtensions.cs index 53f5958d9b14..2aab7ea30b40 100644 --- a/src/Mvc/Mvc.Core/src/Routing/ControllerLinkGeneratorExtensions.cs +++ b/src/Mvc/Mvc.Core/src/Routing/ControllerLinkGeneratorExtensions.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics.CodeAnalysis; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; diff --git a/src/Mvc/Mvc.Core/src/Routing/ControllerRequestDelegateFactory.cs b/src/Mvc/Mvc.Core/src/Routing/ControllerRequestDelegateFactory.cs index e56b2921b503..22fb07f60c6f 100644 --- a/src/Mvc/Mvc.Core/src/Routing/ControllerRequestDelegateFactory.cs +++ b/src/Mvc/Mvc.Core/src/Routing/ControllerRequestDelegateFactory.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics; using System.Linq; using Microsoft.AspNetCore.Http; diff --git a/src/Mvc/Mvc.Core/src/Routing/ConventionalRouteEntry.cs b/src/Mvc/Mvc.Core/src/Routing/ConventionalRouteEntry.cs index 1f0136a00827..8bd18bd31fbe 100644 --- a/src/Mvc/Mvc.Core/src/Routing/ConventionalRouteEntry.cs +++ b/src/Mvc/Mvc.Core/src/Routing/ConventionalRouteEntry.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Globalization; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointMatcherPolicy.cs b/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointMatcherPolicy.cs index d1559fc9a851..9c47e421c3a2 100644 --- a/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointMatcherPolicy.cs +++ b/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointMatcherPolicy.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics; using System.Linq; using Microsoft.AspNetCore.Http; diff --git a/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointSelector.cs b/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointSelector.cs index 3bbfc1448cc2..dcbe630bbc98 100644 --- a/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointSelector.cs +++ b/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointSelector.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointSelectorCache.cs b/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointSelectorCache.cs index 639e351372ff..86138414689f 100644 --- a/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointSelectorCache.cs +++ b/src/Mvc/Mvc.Core/src/Routing/DynamicControllerEndpointSelectorCache.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Collections.Concurrent; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/DynamicControllerMetadata.cs b/src/Mvc/Mvc.Core/src/Routing/DynamicControllerMetadata.cs index dbb4bbe5b23c..df7f3bf5123a 100644 --- a/src/Mvc/Mvc.Core/src/Routing/DynamicControllerMetadata.cs +++ b/src/Mvc/Mvc.Core/src/Routing/DynamicControllerMetadata.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Routing; namespace Microsoft.AspNetCore.Mvc.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/DynamicControllerRouteValueTransformerMetadata.cs b/src/Mvc/Mvc.Core/src/Routing/DynamicControllerRouteValueTransformerMetadata.cs index d9a239dcecd7..780e89669fb7 100644 --- a/src/Mvc/Mvc.Core/src/Routing/DynamicControllerRouteValueTransformerMetadata.cs +++ b/src/Mvc/Mvc.Core/src/Routing/DynamicControllerRouteValueTransformerMetadata.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Routing; namespace Microsoft.AspNetCore.Mvc.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/DynamicRouteValueTransformer.cs b/src/Mvc/Mvc.Core/src/Routing/DynamicRouteValueTransformer.cs index 568186420fad..02ca6616ad3a 100644 --- a/src/Mvc/Mvc.Core/src/Routing/DynamicRouteValueTransformer.cs +++ b/src/Mvc/Mvc.Core/src/Routing/DynamicRouteValueTransformer.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing.Matching; diff --git a/src/Mvc/Mvc.Core/src/Routing/EndpointRoutingUrlHelper.cs b/src/Mvc/Mvc.Core/src/Routing/EndpointRoutingUrlHelper.cs index 7137a4a40fc2..56b4556096c9 100644 --- a/src/Mvc/Mvc.Core/src/Routing/EndpointRoutingUrlHelper.cs +++ b/src/Mvc/Mvc.Core/src/Routing/EndpointRoutingUrlHelper.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Logging; @@ -80,7 +79,6 @@ public EndpointRoutingUrlHelper( values["controller"] = urlActionContext.Controller; } - var path = _linkGenerator.GetPathByRouteValues( ActionContext.HttpContext, routeName: null, diff --git a/src/Mvc/Mvc.Core/src/Routing/HttpMethodAttribute.cs b/src/Mvc/Mvc.Core/src/Routing/HttpMethodAttribute.cs index 9eb8a7b34ab2..ba6bd24b7dd9 100644 --- a/src/Mvc/Mvc.Core/src/Routing/HttpMethodAttribute.cs +++ b/src/Mvc/Mvc.Core/src/Routing/HttpMethodAttribute.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/src/Mvc/Mvc.Core/src/Routing/IRequestDelegateFactory.cs b/src/Mvc/Mvc.Core/src/Routing/IRequestDelegateFactory.cs index 8f1ccae1b7d0..1b1b16318173 100644 --- a/src/Mvc/Mvc.Core/src/Routing/IRequestDelegateFactory.cs +++ b/src/Mvc/Mvc.Core/src/Routing/IRequestDelegateFactory.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/IRouteTemplateProvider.cs b/src/Mvc/Mvc.Core/src/Routing/IRouteTemplateProvider.cs index f5738a593874..8a7f59541e2e 100644 --- a/src/Mvc/Mvc.Core/src/Routing/IRouteTemplateProvider.cs +++ b/src/Mvc/Mvc.Core/src/Routing/IRouteTemplateProvider.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - namespace Microsoft.AspNetCore.Mvc.Routing; /// diff --git a/src/Mvc/Mvc.Core/src/Routing/IRouteValueProvider.cs b/src/Mvc/Mvc.Core/src/Routing/IRouteValueProvider.cs index 4036419d3ecf..4aaa9b24300a 100644 --- a/src/Mvc/Mvc.Core/src/Routing/IRouteValueProvider.cs +++ b/src/Mvc/Mvc.Core/src/Routing/IRouteValueProvider.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/IUrlHelperFactory.cs b/src/Mvc/Mvc.Core/src/Routing/IUrlHelperFactory.cs index dae35d4dab57..8f54e5796bcc 100644 --- a/src/Mvc/Mvc.Core/src/Routing/IUrlHelperFactory.cs +++ b/src/Mvc/Mvc.Core/src/Routing/IUrlHelperFactory.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - namespace Microsoft.AspNetCore.Mvc.Routing; /// diff --git a/src/Mvc/Mvc.Core/src/Routing/KnownRouteValueConstraint.cs b/src/Mvc/Mvc.Core/src/Routing/KnownRouteValueConstraint.cs index 0edee5587e07..5fd972549ca7 100644 --- a/src/Mvc/Mvc.Core/src/Routing/KnownRouteValueConstraint.cs +++ b/src/Mvc/Mvc.Core/src/Routing/KnownRouteValueConstraint.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Globalization; using System.Linq; using Microsoft.AspNetCore.Http; diff --git a/src/Mvc/Mvc.Core/src/Routing/MvcAttributeRouteHandler.cs b/src/Mvc/Mvc.Core/src/Routing/MvcAttributeRouteHandler.cs index a5b283113bd2..ae8be2e98701 100644 --- a/src/Mvc/Mvc.Core/src/Routing/MvcAttributeRouteHandler.cs +++ b/src/Mvc/Mvc.Core/src/Routing/MvcAttributeRouteHandler.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics; using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Infrastructure; diff --git a/src/Mvc/Mvc.Core/src/Routing/MvcRouteHandler.cs b/src/Mvc/Mvc.Core/src/Routing/MvcRouteHandler.cs index 93151e3b510f..507a077e5e50 100644 --- a/src/Mvc/Mvc.Core/src/Routing/MvcRouteHandler.cs +++ b/src/Mvc/Mvc.Core/src/Routing/MvcRouteHandler.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics; using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Infrastructure; diff --git a/src/Mvc/Mvc.Core/src/Routing/NormalizedRouteValue.cs b/src/Mvc/Mvc.Core/src/Routing/NormalizedRouteValue.cs index 2a97d4aa28c1..ca101e4b1053 100644 --- a/src/Mvc/Mvc.Core/src/Routing/NormalizedRouteValue.cs +++ b/src/Mvc/Mvc.Core/src/Routing/NormalizedRouteValue.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Globalization; namespace Microsoft.AspNetCore.Mvc.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/NullRouter.cs b/src/Mvc/Mvc.Core/src/Routing/NullRouter.cs index 99bae2710353..208e58795598 100644 --- a/src/Mvc/Mvc.Core/src/Routing/NullRouter.cs +++ b/src/Mvc/Mvc.Core/src/Routing/NullRouter.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Routing; namespace Microsoft.AspNetCore.Mvc.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/PageLinkGeneratorExtensions.cs b/src/Mvc/Mvc.Core/src/Routing/PageLinkGeneratorExtensions.cs index 9ef316400543..51d6c0fa0ba1 100644 --- a/src/Mvc/Mvc.Core/src/Routing/PageLinkGeneratorExtensions.cs +++ b/src/Mvc/Mvc.Core/src/Routing/PageLinkGeneratorExtensions.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics.CodeAnalysis; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; diff --git a/src/Mvc/Mvc.Core/src/Routing/RoutePatternWriter.cs b/src/Mvc/Mvc.Core/src/Routing/RoutePatternWriter.cs index 367106d876c3..ede4ceeb2a42 100644 --- a/src/Mvc/Mvc.Core/src/Routing/RoutePatternWriter.cs +++ b/src/Mvc/Mvc.Core/src/Routing/RoutePatternWriter.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Text; using Microsoft.AspNetCore.Routing.Patterns; diff --git a/src/Mvc/Mvc.Core/src/Routing/UrlHelper.cs b/src/Mvc/Mvc.Core/src/Routing/UrlHelper.cs index b3b07a8acf5d..deaa3260b78a 100644 --- a/src/Mvc/Mvc.Core/src/Routing/UrlHelper.cs +++ b/src/Mvc/Mvc.Core/src/Routing/UrlHelper.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/UrlHelperFactory.cs b/src/Mvc/Mvc.Core/src/Routing/UrlHelperFactory.cs index 7b3eace05282..5d13633368bc 100644 --- a/src/Mvc/Mvc.Core/src/Routing/UrlHelperFactory.cs +++ b/src/Mvc/Mvc.Core/src/Routing/UrlHelperFactory.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Routing; diff --git a/src/Mvc/Mvc.Core/src/Routing/ViewEnginePath.cs b/src/Mvc/Mvc.Core/src/Routing/ViewEnginePath.cs index 3dc5eb317b8e..cc9b0f32dae8 100644 --- a/src/Mvc/Mvc.Core/src/Routing/ViewEnginePath.cs +++ b/src/Mvc/Mvc.Core/src/Routing/ViewEnginePath.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics; using System.Text; using Microsoft.Extensions.Primitives; diff --git a/src/Mvc/Mvc.Core/test/ApplicationModels/DefaultApplicationModelProviderTest.cs b/src/Mvc/Mvc.Core/test/ApplicationModels/DefaultApplicationModelProviderTest.cs index 691032dd92b6..e910a21f19e6 100644 --- a/src/Mvc/Mvc.Core/test/ApplicationModels/DefaultApplicationModelProviderTest.cs +++ b/src/Mvc/Mvc.Core/test/ApplicationModels/DefaultApplicationModelProviderTest.cs @@ -1320,7 +1320,6 @@ public void CreatePropertyModel_DoesNotSetBindingInfo_IfPropertySpecifiesBinderS Assert.Same(BindingSource.Path, property.BindingInfo.BindingSource); } - public class DerivedFromBindPropertyController : BindPropertyController { public string DerivedProperty { get; set; } diff --git a/src/Mvc/Mvc.Core/test/ApplicationModels/InvalidModelStateFilterConventionTest.cs b/src/Mvc/Mvc.Core/test/ApplicationModels/InvalidModelStateFilterConventionTest.cs index 4ba58e240a08..3dd2fa63a838 100644 --- a/src/Mvc/Mvc.Core/test/ApplicationModels/InvalidModelStateFilterConventionTest.cs +++ b/src/Mvc/Mvc.Core/test/ApplicationModels/InvalidModelStateFilterConventionTest.cs @@ -21,7 +21,6 @@ public void Apply_AddsFilter() Assert.Single(action.Filters.OfType()); } - private static ActionModel GetActionModel() { var action = new ActionModel(typeof(object).GetMethods()[0], new object[0]); diff --git a/src/Mvc/Mvc.Core/test/ControllerBaseTest.cs b/src/Mvc/Mvc.Core/test/ControllerBaseTest.cs index 1e793fba8b3a..deeda17dd25b 100644 --- a/src/Mvc/Mvc.Core/test/ControllerBaseTest.cs +++ b/src/Mvc/Mvc.Core/test/ControllerBaseTest.cs @@ -2715,7 +2715,6 @@ public async Task TryUpdateModel_IncludeExpressionOverload_UsesPassedArguments(s Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude2"])); }); - var controller = GetController(binder, valueProvider.Object); var model = new MyModel(); @@ -3120,7 +3119,6 @@ private class TryValidateModelModel public int IntegerProperty { get; set; } } - private class TestableController : ControllerBase { } diff --git a/src/Mvc/Mvc.Core/test/DependencyInjection/MvcCoreBuilderExtensionsTest.cs b/src/Mvc/Mvc.Core/test/DependencyInjection/MvcCoreBuilderExtensionsTest.cs index dc44ed7bf65d..eaaa5657eb04 100644 --- a/src/Mvc/Mvc.Core/test/DependencyInjection/MvcCoreBuilderExtensionsTest.cs +++ b/src/Mvc/Mvc.Core/test/DependencyInjection/MvcCoreBuilderExtensionsTest.cs @@ -100,7 +100,6 @@ public void ConfigureApiBehaviorOptions_InvokesSetupAction() Assert.True(options.SuppressMapClientErrors); } - private class TestApplicationPartFactory : ApplicationPartFactory { public static readonly ApplicationPart TestPart = Mock.Of(); diff --git a/src/Mvc/Mvc.Core/test/Filters/FilterFactoryTest.cs b/src/Mvc/Mvc.Core/test/Filters/FilterFactoryTest.cs index 97dbb808569d..d114ce4be7ad 100644 --- a/src/Mvc/Mvc.Core/test/Filters/FilterFactoryTest.cs +++ b/src/Mvc/Mvc.Core/test/Filters/FilterFactoryTest.cs @@ -62,7 +62,6 @@ public void GetAllFilters_CachesAllFilters() }); var filterProviders = new[] { new DefaultFilterProvider() }; - // Act - 1 var filterResult = FilterFactory.GetAllFilters(filterProviders, actionContext); var request1Filters = filterResult.Filters; diff --git a/src/Mvc/Mvc.Core/test/Formatters/JsonOutputFormatterTestBase.cs b/src/Mvc/Mvc.Core/test/Formatters/JsonOutputFormatterTestBase.cs index 48663036ffce..1e8a0a0c666a 100644 --- a/src/Mvc/Mvc.Core/test/Formatters/JsonOutputFormatterTestBase.cs +++ b/src/Mvc/Mvc.Core/test/Formatters/JsonOutputFormatterTestBase.cs @@ -85,7 +85,6 @@ public async Task WriteToStreamAsync_UsesCorrectCharacterEncoding( var mediaType = MediaTypeHeaderValue.Parse(string.Format(CultureInfo.InvariantCulture, "application/json; charset={0}", encodingAsString)); var encoding = CreateOrGetSupportedEncoding(formatter, encodingAsString, isDefaultEncoding); - var body = new MemoryStream(); var actionContext = GetActionContext(mediaType, body); @@ -168,7 +167,6 @@ protected static ActionContext GetActionContext( httpContext.Request.ContentType = contentType.ToString(); httpContext.Request.Headers.AcceptCharset = contentType.Charset.ToString(); - httpContext.Response.Body = responseStream ?? new MemoryStream(); return new ActionContext(httpContext, new RouteData(), new ActionDescriptor()); } diff --git a/src/Mvc/Mvc.Core/test/ModelBinding/Metadata/CompositeBindingSourceTest.cs b/src/Mvc/Mvc.Core/test/ModelBinding/Metadata/CompositeBindingSourceTest.cs index d639279798ce..e8763d3e5379 100644 --- a/src/Mvc/Mvc.Core/test/ModelBinding/Metadata/CompositeBindingSourceTest.cs +++ b/src/Mvc/Mvc.Core/test/ModelBinding/Metadata/CompositeBindingSourceTest.cs @@ -22,7 +22,6 @@ public void CompositeBindingSourceTest_CanAcceptDataFrom_ThrowsOnComposite() var expected = "The provided binding source 'Test Source2' is a composite. " + $"'{nameof(composite1.CanAcceptDataFrom)}' requires that the source must represent a single type of input."; - // Act & Assert ExceptionAssert.ThrowsArgument( () => composite1.CanAcceptDataFrom(composite2), diff --git a/src/Mvc/Mvc.Core/test/ModelBinding/PrefixContainerTest.cs b/src/Mvc/Mvc.Core/test/ModelBinding/PrefixContainerTest.cs index c6ae78a1d924..332893af4b6d 100644 --- a/src/Mvc/Mvc.Core/test/ModelBinding/PrefixContainerTest.cs +++ b/src/Mvc/Mvc.Core/test/ModelBinding/PrefixContainerTest.cs @@ -69,7 +69,6 @@ public void ContainsPrefix_HasEntries_NoMatch(string prefix) Assert.False(result); } - [Theory] [InlineData("a")] [InlineData("b")] diff --git a/src/Mvc/Mvc.Core/test/ModelBinding/Validation/ExplicitIndexCollectionValidationStrategyTest.cs b/src/Mvc/Mvc.Core/test/ModelBinding/Validation/ExplicitIndexCollectionValidationStrategyTest.cs index d8733b6239ca..893eb60038ff 100644 --- a/src/Mvc/Mvc.Core/test/ModelBinding/Validation/ExplicitIndexCollectionValidationStrategyTest.cs +++ b/src/Mvc/Mvc.Core/test/ModelBinding/Validation/ExplicitIndexCollectionValidationStrategyTest.cs @@ -3,7 +3,6 @@ using System.Collections; - namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation; public class ExplicitIndexCollectionValidationStrategyTest diff --git a/src/Mvc/Mvc.Core/test/Routing/AttributeRouteTest.cs b/src/Mvc/Mvc.Core/test/Routing/AttributeRouteTest.cs index cf4a457d42b6..edc190775eb6 100644 --- a/src/Mvc/Mvc.Core/test/Routing/AttributeRouteTest.cs +++ b/src/Mvc/Mvc.Core/test/Routing/AttributeRouteTest.cs @@ -45,7 +45,6 @@ public async Task AttributeRoute_UsesUpdatedActionDescriptors() }, }; - Func handlerFactory = (_) => { var handler = new Mock(); @@ -650,7 +649,6 @@ public void GetEntries_DoesNotCreateOutboundEntriesForAttributesWithSuppressForL }); } - [Fact] public void GetEntries_DoesNotCreateInboundEntriesForAttributesWithSuppressForPathMatchingSetToTrue() { diff --git a/src/Mvc/Mvc.DataAnnotations/test/ModelMetadataProviderTest.cs b/src/Mvc/Mvc.DataAnnotations/test/ModelMetadataProviderTest.cs index 049b25c8fe78..6fd128a4a232 100644 --- a/src/Mvc/Mvc.DataAnnotations/test/ModelMetadataProviderTest.cs +++ b/src/Mvc/Mvc.DataAnnotations/test/ModelMetadataProviderTest.cs @@ -57,7 +57,6 @@ public void ModelMetadataProvider_ReadsModelNameProperty_ForTypes() Assert.Equal("TypePrefix", metadata.BinderModelName); } - [Fact] public void ModelMetadataProvider_ReadsScaffoldColumnAttribute_ForShowForDisplay() { diff --git a/src/Mvc/Mvc.DataAnnotations/test/ValidatableObjectAdapterTest.cs b/src/Mvc/Mvc.DataAnnotations/test/ValidatableObjectAdapterTest.cs index 7ed25ae82257..0034138a2ac4 100644 --- a/src/Mvc/Mvc.DataAnnotations/test/ValidatableObjectAdapterTest.cs +++ b/src/Mvc/Mvc.DataAnnotations/test/ValidatableObjectAdapterTest.cs @@ -107,7 +107,6 @@ public static TheoryData Validate_R } } - [Theory] [MemberData(nameof(Validate_PassesExpectedNamesData))] public void Validate_PassesExpectedNames( diff --git a/src/Mvc/Mvc.Formatters.Xml/test/XmlDataContractSerializerInputFormatterTest.cs b/src/Mvc/Mvc.Formatters.Xml/test/XmlDataContractSerializerInputFormatterTest.cs index f5cb07df3e75..4f96e1c81b96 100644 --- a/src/Mvc/Mvc.Formatters.Xml/test/XmlDataContractSerializerInputFormatterTest.cs +++ b/src/Mvc/Mvc.Formatters.Xml/test/XmlDataContractSerializerInputFormatterTest.cs @@ -400,7 +400,6 @@ public async Task ReadAsync_ReadsWhenMaxDepthIsModified() var contentBytes = Encoding.UTF8.GetBytes(input); var context = GetInputFormatterContext(contentBytes, typeof(DummyClass)); - // Act var result = await formatter.ReadAsync(context); diff --git a/src/Mvc/Mvc.NewtonsoftJson/src/DependencyInjection/NewtonsoftJsonMvcCoreBuilderExtensions.cs b/src/Mvc/Mvc.NewtonsoftJson/src/DependencyInjection/NewtonsoftJsonMvcCoreBuilderExtensions.cs index 6ec8a2b39c85..8011c4dcd095 100644 --- a/src/Mvc/Mvc.NewtonsoftJson/src/DependencyInjection/NewtonsoftJsonMvcCoreBuilderExtensions.cs +++ b/src/Mvc/Mvc.NewtonsoftJson/src/DependencyInjection/NewtonsoftJsonMvcCoreBuilderExtensions.cs @@ -71,7 +71,6 @@ internal static void AddServicesCore(IServiceCollection services) services.TryAddEnumerable( ServiceDescriptor.Transient()); - var jsonResultExecutor = services.FirstOrDefault(f => f.ServiceType == typeof(IActionResultExecutor) && f.ImplementationType?.Assembly == typeof(JsonResult).Assembly); diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs index e02585781c17..0860a545514f 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs @@ -31,7 +31,6 @@ public FileProviderRazorProjectFileSystem(RuntimeCompilationFileProvider filePro public IFileProvider FileProvider => _fileProvider.FileProvider; - public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs index 08ce30d049e6..6a286a57ff4e 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs @@ -76,7 +76,6 @@ public override IEnumerable FindHierarchicalItems(string baseP return Enumerable.Empty(); } - public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/RuntimeViewCompiler.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/RuntimeViewCompiler.cs index c075ff7fc54a..e7b90aee14f9 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/RuntimeViewCompiler.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/RuntimeViewCompiler.cs @@ -67,7 +67,6 @@ public RuntimeViewCompiler( _csharpCompiler = csharpCompiler; _logger = logger; - _normalizedPathCache = new ConcurrentDictionary(StringComparer.Ordinal); // This is our L0 cache, and is a durable store. Views migrate into the cache as they are requested diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/CSharpCompilerTest.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/CSharpCompilerTest.cs index 0346a9bf5545..64d8a288855f 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/CSharpCompilerTest.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/CSharpCompilerTest.cs @@ -154,7 +154,6 @@ public void Constructor_ConfiguresLanguageVersion() Assert.Equal(LanguageVersion.CSharp7_1, compilationOptions.LanguageVersion); } - [Fact] public void EmitOptions_ReadsDebugTypeFromDependencyContext() { diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/RuntimeViewCompilerTest.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/RuntimeViewCompilerTest.cs index cc6d2bc35565..bbabadaedaae 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/RuntimeViewCompilerTest.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/RuntimeViewCompilerTest.cs @@ -826,7 +826,6 @@ private static TestRazorViewCompiler GetViewCompiler( }); var compilationFileProvider = new RuntimeCompilationFileProvider(options); - referenceManager = referenceManager ?? CreateReferenceManager(); precompiledViews = precompiledViews ?? Array.Empty(); diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs index 89b5880d468d..4df10f11a77e 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs @@ -14,7 +14,6 @@ public override IEnumerable EnumerateItems(string basePath) return directory?.EnumerateItems() ?? Enumerable.Empty(); } - public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Mvc/Mvc.Razor/test/RazorPageTest.cs b/src/Mvc/Mvc.Razor/test/RazorPageTest.cs index 0784afe17701..f61590f84771 100644 --- a/src/Mvc/Mvc.Razor/test/RazorPageTest.cs +++ b/src/Mvc/Mvc.Razor/test/RazorPageTest.cs @@ -1383,7 +1383,6 @@ private static TestableRazorPage CreatePage( }, context); } - private static TestableRazorPage CreatePage( Func executeAction, ViewContext context = null) diff --git a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/DefaultPageApplicationModelPartsProvider.cs b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/DefaultPageApplicationModelPartsProvider.cs index 2352eef382ab..1d99017be541 100644 --- a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/DefaultPageApplicationModelPartsProvider.cs +++ b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/DefaultPageApplicationModelPartsProvider.cs @@ -17,7 +17,6 @@ internal class DefaultPageApplicationModelPartsProvider : IPageApplicationModelP private readonly Func _supportsAllRequests; private readonly Func _supportsNonGetRequests; - public DefaultPageApplicationModelPartsProvider(IModelMetadataProvider modelMetadataProvider) { _modelMetadataProvider = modelMetadataProvider; diff --git a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageRouteModelFactory.cs b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageRouteModelFactory.cs index 32f88c8e0bcb..acc6e1075c37 100644 --- a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageRouteModelFactory.cs +++ b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageRouteModelFactory.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - using System.Diagnostics; using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.AspNetCore.Mvc.RazorPages; diff --git a/src/Mvc/Mvc.RazorPages/test/Filters/PageHandlerResultFilterTest.cs b/src/Mvc/Mvc.RazorPages/test/Filters/PageHandlerResultFilterTest.cs index 79804115923f..04f4d7919ea0 100644 --- a/src/Mvc/Mvc.RazorPages/test/Filters/PageHandlerResultFilterTest.cs +++ b/src/Mvc/Mvc.RazorPages/test/Filters/PageHandlerResultFilterTest.cs @@ -22,7 +22,6 @@ public async Task OnResultExecutionAsync_ExecutesAsyncFilters() new ModelStateDictionary())); var model = new Mock(); - var modelAsFilter = model.As(); modelAsFilter .Setup(f => f.OnResultExecutionAsync(It.IsAny(), It.IsAny())) diff --git a/src/Mvc/Mvc.RazorPages/test/Infrastructure/DefaultPageActivatorProviderTest.cs b/src/Mvc/Mvc.RazorPages/test/Infrastructure/DefaultPageActivatorProviderTest.cs index 617493b8e15e..ac46d6bd8be2 100644 --- a/src/Mvc/Mvc.RazorPages/test/Infrastructure/DefaultPageActivatorProviderTest.cs +++ b/src/Mvc/Mvc.RazorPages/test/Infrastructure/DefaultPageActivatorProviderTest.cs @@ -37,7 +37,6 @@ public void CreateActivator_ReturnsFactoryForPage(Type type) PageTypeInfo = type.GetTypeInfo(), }; - var activator = new DefaultPageActivatorProvider(); // Act diff --git a/src/Mvc/Mvc.RazorPages/test/Infrastructure/ExecutorFactoryTest.cs b/src/Mvc/Mvc.RazorPages/test/Infrastructure/ExecutorFactoryTest.cs index 2e44f0fa10fa..984104f7a6d6 100644 --- a/src/Mvc/Mvc.RazorPages/test/Infrastructure/ExecutorFactoryTest.cs +++ b/src/Mvc/Mvc.RazorPages/test/Infrastructure/ExecutorFactoryTest.cs @@ -257,7 +257,6 @@ public Task TaskReturningConcreteSubtype(string arg = "value") }); } - public override Task ExecuteAsync() { throw new NotImplementedException(); diff --git a/src/Mvc/Mvc.RazorPages/test/Infrastructure/PageBinderFactoryTest.cs b/src/Mvc/Mvc.RazorPages/test/Infrastructure/PageBinderFactoryTest.cs index 2105a236d537..c8532ab30b00 100644 --- a/src/Mvc/Mvc.RazorPages/test/Infrastructure/PageBinderFactoryTest.cs +++ b/src/Mvc/Mvc.RazorPages/test/Infrastructure/PageBinderFactoryTest.cs @@ -755,7 +755,6 @@ public async Task FactoryRecordsErrorWhenValueProviderThrowsValueProviderExcepti Assert.Equal("Some error", error.ErrorMessage); } - private static CompiledPageActionDescriptor GetActionDescriptorWithHandlerMethod(Type type, string method) { var handlerMethodInfo = type.GetMethod(method); diff --git a/src/Mvc/Mvc.TagHelpers/test/FormTagHelperTest.cs b/src/Mvc/Mvc.TagHelpers/test/FormTagHelperTest.cs index 220209e0caac..38a4c7985469 100644 --- a/src/Mvc/Mvc.TagHelpers/test/FormTagHelperTest.cs +++ b/src/Mvc/Mvc.TagHelpers/test/FormTagHelperTest.cs @@ -990,7 +990,6 @@ public async Task ProcessAsync_SupportsAntiforgeryIfActionIsSpecified( items: new Dictionary(), uniqueId: "test"); - // Act await formTagHelper.ProcessAsync(context, output); diff --git a/src/Mvc/Mvc.ViewFeatures/src/ITempDataDictionary.cs b/src/Mvc/Mvc.ViewFeatures/src/ITempDataDictionary.cs index 1765cd304a69..17f013adfc2a 100644 --- a/src/Mvc/Mvc.ViewFeatures/src/ITempDataDictionary.cs +++ b/src/Mvc/Mvc.ViewFeatures/src/ITempDataDictionary.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ViewFeatures; /// diff --git a/src/Mvc/Mvc.ViewFeatures/src/RemoteAttributeBase.cs b/src/Mvc/Mvc.ViewFeatures/src/RemoteAttributeBase.cs index 95f345fcc111..84519e2514c0 100644 --- a/src/Mvc/Mvc.ViewFeatures/src/RemoteAttributeBase.cs +++ b/src/Mvc/Mvc.ViewFeatures/src/RemoteAttributeBase.cs @@ -15,7 +15,6 @@ using Microsoft.Extensions.Options; using Resources = Microsoft.AspNetCore.Mvc.ViewFeatures.Resources; - namespace Microsoft.AspNetCore.Mvc; /// diff --git a/src/Mvc/Mvc.ViewFeatures/src/ViewComponents/ContentViewComponentResult.cs b/src/Mvc/Mvc.ViewFeatures/src/ViewComponents/ContentViewComponentResult.cs index 5e6370fd2633..7ad2487df691 100644 --- a/src/Mvc/Mvc.ViewFeatures/src/ViewComponents/ContentViewComponentResult.cs +++ b/src/Mvc/Mvc.ViewFeatures/src/ViewComponents/ContentViewComponentResult.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ViewComponents; /// diff --git a/src/Mvc/Mvc.ViewFeatures/src/ViewEngines/ICompositeViewEngine.cs b/src/Mvc/Mvc.ViewFeatures/src/ViewEngines/ICompositeViewEngine.cs index 728d5dc210cc..a03e14337b2b 100644 --- a/src/Mvc/Mvc.ViewFeatures/src/ViewEngines/ICompositeViewEngine.cs +++ b/src/Mvc/Mvc.ViewFeatures/src/ViewEngines/ICompositeViewEngine.cs @@ -3,7 +3,6 @@ #nullable enable - namespace Microsoft.AspNetCore.Mvc.ViewEngines; /// diff --git a/src/Mvc/Mvc.ViewFeatures/test/AttributeDictionaryTest.cs b/src/Mvc/Mvc.ViewFeatures/test/AttributeDictionaryTest.cs index 28a2122e2d5a..bca1099929b4 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/AttributeDictionaryTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/AttributeDictionaryTest.cs @@ -329,7 +329,6 @@ public void AttributeDictionary_TryGetValue_Failure() // Act var result = attributes.TryGetValue("nada", out value); - // Assert Assert.False(result); Assert.Null(value); diff --git a/src/Mvc/Mvc.ViewFeatures/test/CachedExpressionCompilerTest.cs b/src/Mvc/Mvc.ViewFeatures/test/CachedExpressionCompilerTest.cs index b90f5e8411d5..0fcc1d19ce17 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/CachedExpressionCompilerTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/CachedExpressionCompilerTest.cs @@ -850,7 +850,6 @@ public void Process_CapturedVariable_WithNullModel() Assert.Same(differentModel, result); } - [Fact] public void Process_MemberAccess_OnCapturedVariable_ReturnsNull() { diff --git a/src/Mvc/Mvc.ViewFeatures/test/CookieTempDataProviderTest.cs b/src/Mvc/Mvc.ViewFeatures/test/CookieTempDataProviderTest.cs index a90c639f7ea4..2cbb4e8902b6 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/CookieTempDataProviderTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/CookieTempDataProviderTest.cs @@ -348,7 +348,6 @@ private void UpdateRequestWithCookies(HttpContext httpContext) { var responseCookies = httpContext.Response.GetTypedHeaders().SetCookie; - if (responseCookies.Count > 0) { var stringBuilder = new StringBuilder(); diff --git a/src/Mvc/Mvc.ViewFeatures/test/RazorComponents/HtmlRendererTest.cs b/src/Mvc/Mvc.ViewFeatures/test/RazorComponents/HtmlRendererTest.cs index c8845c0de376..fd4222ec11cf 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/RazorComponents/HtmlRendererTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/RazorComponents/HtmlRendererTest.cs @@ -75,7 +75,6 @@ public void RenderComponentAsync_HtmlEncodesContent() AssertHtmlContentEquals(expectedHtml, result); } - [Fact] public void RenderComponentAsync_DoesNotEncodeMarkup() { diff --git a/src/Mvc/Mvc.ViewFeatures/test/Rendering/HtmlHelperDisplayExtensionsTest.cs b/src/Mvc/Mvc.ViewFeatures/test/Rendering/HtmlHelperDisplayExtensionsTest.cs index 33a1b66a5943..0cc51ba2e169 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/Rendering/HtmlHelperDisplayExtensionsTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/Rendering/HtmlHelperDisplayExtensionsTest.cs @@ -506,7 +506,6 @@ public void DisplayForModel_UsesTemplateNameAndHtmlFieldName() Assert.Equal("SomeField", HtmlContentUtilities.HtmlContentToString(displayResult)); } - public class StatusResource { public static string FaultedKey { get { return "Faulted from ResourceType"; } } diff --git a/src/Mvc/Mvc.ViewFeatures/test/Rendering/JsonHelperTestBase.cs b/src/Mvc/Mvc.ViewFeatures/test/Rendering/JsonHelperTestBase.cs index 9ae9a5057c6b..ff37d3aac171 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/Rendering/JsonHelperTestBase.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/Rendering/JsonHelperTestBase.cs @@ -100,7 +100,6 @@ public void Serialize_WithHTMLEntities() Assert.Equal(expectedOutput, htmlString.ToString()); } - [Fact] public virtual void Serialize_WithHTMLNonAsciiAndControlChars() { diff --git a/src/Mvc/Mvc.ViewFeatures/test/Rendering/TagBuilderTest.cs b/src/Mvc/Mvc.ViewFeatures/test/Rendering/TagBuilderTest.cs index d3bccf7437bd..1dc83a025870 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/Rendering/TagBuilderTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/Rendering/TagBuilderTest.cs @@ -260,7 +260,6 @@ public void Constructor_Copy_CopiesTagRenderMode() // Act var clonedTagBuilder = new TagBuilder(originalTagBuilder); - // Assert Assert.Equal(originalTagBuilder.TagRenderMode, clonedTagBuilder.TagRenderMode); } diff --git a/src/Mvc/Mvc.ViewFeatures/test/ViewComponentResultTest.cs b/src/Mvc/Mvc.ViewFeatures/test/ViewComponentResultTest.cs index 1d91efe2d310..fed8cc6097c8 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/ViewComponentResultTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/ViewComponentResultTest.cs @@ -152,7 +152,6 @@ public async Task ExecuteResultAsync_Throws_IfViewComponentCouldNotBeFound_ByTyp var services = CreateServices(diagnosticListener: null, context: actionContext.HttpContext); services.AddSingleton(); - var viewComponentResult = new ViewComponentResult { ViewComponentType = typeof(TextViewComponent), diff --git a/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/DefaultViewComponentActivatorTests.cs b/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/DefaultViewComponentActivatorTests.cs index 37660feaf05b..a520779ec036 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/DefaultViewComponentActivatorTests.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/DefaultViewComponentActivatorTests.cs @@ -110,7 +110,6 @@ private class VisibilityViewComponent : ViewComponent protected internal ViewComponentContext C { get; set; } } - public class ActivablePropertiesViewComponent : IDisposable { [ViewComponentContext] diff --git a/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/ViewComponentConventionsTest.cs b/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/ViewComponentConventionsTest.cs index cdacba51b082..098ce1c422db 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/ViewComponentConventionsTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/ViewComponents/ViewComponentConventionsTest.cs @@ -146,7 +146,6 @@ public class CaseInsensitiveNamingConventionVIEWCOMPONENT { } - [ViewComponent] public class WithAttribute { diff --git a/src/Mvc/Mvc.ViewFeatures/test/ViewEngines/CompositeViewEngineTest.cs b/src/Mvc/Mvc.ViewFeatures/test/ViewEngines/CompositeViewEngineTest.cs index 67bad19146cd..f60fe4c5afdc 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/ViewEngines/CompositeViewEngineTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/ViewEngines/CompositeViewEngineTest.cs @@ -46,7 +46,6 @@ public void FindView_IsMainPage_Throws_WhenNoViewEnginesAreRegistered() Assert.Equal(expected, exception.Message); } - [Fact] public void FindView_IsMainPage_ReturnsNotFoundResult_WhenExactlyOneViewEngineIsRegisteredWhichReturnsNotFoundResult() { @@ -175,7 +174,6 @@ public void GetView_ReturnsNotFoundResult_WhenNoViewEnginesAreRegistered(bool is Assert.Equal(expected, exception.Message); } - [Theory] [InlineData(false)] [InlineData(true)] diff --git a/src/Mvc/perf/Microbenchmarks/Microsoft.AspNetCore.Mvc/ActionSelectorBenchmark.cs b/src/Mvc/perf/Microbenchmarks/Microsoft.AspNetCore.Mvc/ActionSelectorBenchmark.cs index 4103f7f50e79..bf4dc73ae27b 100644 --- a/src/Mvc/perf/Microbenchmarks/Microsoft.AspNetCore.Mvc/ActionSelectorBenchmark.cs +++ b/src/Mvc/perf/Microbenchmarks/Microsoft.AspNetCore.Mvc/ActionSelectorBenchmark.cs @@ -177,7 +177,6 @@ private static KeyValuePair>(routeValues, matches)); } diff --git a/src/Mvc/perf/Microbenchmarks/Microsoft.AspNetCore.Mvc/RuntimePerformanceBenchmarkBase.cs b/src/Mvc/perf/Microbenchmarks/Microsoft.AspNetCore.Mvc/RuntimePerformanceBenchmarkBase.cs index e0b829077175..ad4d1a0993e1 100644 --- a/src/Mvc/perf/Microbenchmarks/Microsoft.AspNetCore.Mvc/RuntimePerformanceBenchmarkBase.cs +++ b/src/Mvc/perf/Microbenchmarks/Microsoft.AspNetCore.Mvc/RuntimePerformanceBenchmarkBase.cs @@ -68,7 +68,6 @@ public override async Task ExecuteAsync( } } - private class BenchmarkHostingEnvironment : IWebHostEnvironment { public BenchmarkHostingEnvironment() diff --git a/src/Mvc/test/Mvc.FunctionalTests/ApiExplorerTest.cs b/src/Mvc/test/Mvc.FunctionalTests/ApiExplorerTest.cs index 398b63130e0b..032b8fff864b 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/ApiExplorerTest.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/ApiExplorerTest.cs @@ -917,7 +917,6 @@ public async Task ApiExplorer_ResponseContentType_NoMatch() var description = Assert.Single(result); var responseType = Assert.Single(description.SupportedResponseTypes); - Assert.Equal(typeof(Product).FullName, responseType.ResponseType); Assert.Equal(200, responseType.StatusCode); Assert.Equal(expectedMediaTypes, GetSortedMediaTypes(responseType)); diff --git a/src/Mvc/test/Mvc.FunctionalTests/HtmlGenerationTest.cs b/src/Mvc/test/Mvc.FunctionalTests/HtmlGenerationTest.cs index e9ca77099f0e..426fca79e0ad 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/HtmlGenerationTest.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/HtmlGenerationTest.cs @@ -276,7 +276,6 @@ public async Task HtmlGenerationWebSite_GenerateEncodedResults(string action, st } } - [ConditionalTheory] [InlineData("Link", null)] [InlineData("Script", null)] diff --git a/src/Mvc/test/Mvc.FunctionalTests/Infrastructure/ResourceFile.cs b/src/Mvc/test/Mvc.FunctionalTests/Infrastructure/ResourceFile.cs index c80193d6680e..c6139d37b481 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/Infrastructure/ResourceFile.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/Infrastructure/ResourceFile.cs @@ -42,7 +42,6 @@ public static void UpdateOrVerify(Assembly assembly, string outputFile, string e } } - /// /// Return for from 's /// manifest. diff --git a/src/Mvc/test/Mvc.FunctionalTests/RazorPagesTest.cs b/src/Mvc/test/Mvc.FunctionalTests/RazorPagesTest.cs index 25292f8e775f..38852323bb17 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/RazorPagesTest.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/RazorPagesTest.cs @@ -402,7 +402,6 @@ public async Task HelloWorldWithPageModelHandler_CanPostContent() var formToken = AntiforgeryTestHelper.RetrieveAntiforgeryToken(getResponseBody, "/HelloWorlWithPageModelHandler"); var cookie = AntiforgeryTestHelper.RetrieveAntiforgeryCookie(getResponse); - var postRequest = new HttpRequestMessage(HttpMethod.Post, "http://localhost/HelloWorldWithPageModelHandler"); postRequest.Headers.Add("Cookie", cookie.Key + "=" + cookie.Value); postRequest.Headers.Add("RequestVerificationToken", formToken); diff --git a/src/Mvc/test/Mvc.FunctionalTests/RoutingEndpointRoutingTest.cs b/src/Mvc/test/Mvc.FunctionalTests/RoutingEndpointRoutingTest.cs index 3033848b9038..ed6bc854db55 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/RoutingEndpointRoutingTest.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/RoutingEndpointRoutingTest.cs @@ -403,7 +403,6 @@ public async Task LinkGenerator_EndpointName_LinkToConventionalRoutedAction_With Assert.Equal("/EndpointName/LinkToConventionalRouted", body); } - [Fact] public async Task LinkGenerator_EndpointName_LinkToAttributeRoutedAction() { diff --git a/src/Mvc/test/Mvc.FunctionalTests/VersioningTestsBase.cs b/src/Mvc/test/Mvc.FunctionalTests/VersioningTestsBase.cs index 6b51c7f53cc3..16c1953d446a 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/VersioningTestsBase.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/VersioningTestsBase.cs @@ -291,7 +291,6 @@ public async Task VersionedApi_OverlappingVersionRanges_FallsBackToLowerOrderAct Assert.Equal("Get", result.Action); } - [Theory] [InlineData("GET", "Get")] [InlineData("POST", "Post")] diff --git a/src/Mvc/test/Mvc.FunctionalTests/XmlSerializerFormattersWrappingTest.cs b/src/Mvc/test/Mvc.FunctionalTests/XmlSerializerFormattersWrappingTest.cs index 3b993b6dc47b..c97617c0b774 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/XmlSerializerFormattersWrappingTest.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/XmlSerializerFormattersWrappingTest.cs @@ -148,7 +148,6 @@ public async Task CanWrite_WrappedTypes_Empty(string url) result); } - [Theory] [InlineData("http://localhost/IEnumerable/WrappedTypes_NullInstance")] [InlineData("http://localhost/IQueryable/WrappedTypes_NullInstance")] diff --git a/src/Mvc/test/Mvc.IntegrationTests/ValidationWithRecordIntegrationTests.cs b/src/Mvc/test/Mvc.IntegrationTests/ValidationWithRecordIntegrationTests.cs index ce8fb25e528c..d955ead3fc7d 100644 --- a/src/Mvc/test/Mvc.IntegrationTests/ValidationWithRecordIntegrationTests.cs +++ b/src/Mvc/test/Mvc.IntegrationTests/ValidationWithRecordIntegrationTests.cs @@ -227,7 +227,6 @@ public async Task Validation_RequiredAttribute_OnSimpleTypeProperty_NoData() private record Order2([Required] Person2 Customer); - private record Person2(string Name); [Fact] diff --git a/src/Mvc/test/WebSites/ApplicationModelWebSite/Conventions/ActionDescriptionAttribute.cs b/src/Mvc/test/WebSites/ApplicationModelWebSite/Conventions/ActionDescriptionAttribute.cs index 49e4c9e5253b..439b71107dda 100644 --- a/src/Mvc/test/WebSites/ApplicationModelWebSite/Conventions/ActionDescriptionAttribute.cs +++ b/src/Mvc/test/WebSites/ApplicationModelWebSite/Conventions/ActionDescriptionAttribute.cs @@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Mvc.ApplicationModels; - namespace ApplicationModelWebSite; public class ActionDescriptionAttribute : Attribute, IActionModelConvention diff --git a/src/Mvc/test/WebSites/ApplicationModelWebSite/Conventions/ApplicationDescription.cs b/src/Mvc/test/WebSites/ApplicationModelWebSite/Conventions/ApplicationDescription.cs index d088ea577735..cd906a46b552 100644 --- a/src/Mvc/test/WebSites/ApplicationModelWebSite/Conventions/ApplicationDescription.cs +++ b/src/Mvc/test/WebSites/ApplicationModelWebSite/Conventions/ApplicationDescription.cs @@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Mvc.ApplicationModels; - namespace ApplicationModelWebSite; public class ApplicationDescription : IApplicationModelConvention diff --git a/src/Mvc/test/WebSites/BasicWebSite/Controllers/TestingController.cs b/src/Mvc/test/WebSites/BasicWebSite/Controllers/TestingController.cs index 43e16f19471f..5d18f5af9f85 100644 --- a/src/Mvc/test/WebSites/BasicWebSite/Controllers/TestingController.cs +++ b/src/Mvc/test/WebSites/BasicWebSite/Controllers/TestingController.cs @@ -111,7 +111,6 @@ public IActionResult AntiforgerySimulator([FromRoute] int value) return Ok(); } - [HttpPost("Testing/PostRedirectGet/Post/{value}")] public IActionResult PostRedirectGetPost([FromRoute] int value) { diff --git a/src/Mvc/test/WebSites/GenericHostWebSite/Controllers/TestingController.cs b/src/Mvc/test/WebSites/GenericHostWebSite/Controllers/TestingController.cs index 88db3257e88f..32706ec8741e 100644 --- a/src/Mvc/test/WebSites/GenericHostWebSite/Controllers/TestingController.cs +++ b/src/Mvc/test/WebSites/GenericHostWebSite/Controllers/TestingController.cs @@ -97,7 +97,6 @@ public IActionResult AntiforgerySimulator([FromRoute] int value) return Ok(); } - [HttpPost("Testing/PostRedirectGet/Post/{value}")] public IActionResult PostRedirectGetPost([FromRoute] int value) { diff --git a/src/Mvc/test/WebSites/RazorPagesWebSite/PolymorphicModelBinder.cs b/src/Mvc/test/WebSites/RazorPagesWebSite/PolymorphicModelBinder.cs index 0094b117c728..b55a9b5a8bd4 100644 --- a/src/Mvc/test/WebSites/RazorPagesWebSite/PolymorphicModelBinder.cs +++ b/src/Mvc/test/WebSites/RazorPagesWebSite/PolymorphicModelBinder.cs @@ -17,7 +17,6 @@ public Task BindModelAsync(ModelBindingContext bindingContext) age = int.Parse(ageValue.FirstValue, CultureInfo.InvariantCulture); } - var model = new UserModel { Name = bindingContext.ValueProvider.GetValue(nameof(UserModel.Name)).FirstValue, diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs index fb2c18f0fb52..0077e9f35471 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -224,7 +224,6 @@ private static void ValidatePublishedServiceWorker(Project project) public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithLocalDB(BrowserKind browserKind) => BlazorWasmHostedTemplate_IndividualAuth_Works(browserKind, true); - // This test depends on BlazorWasmTemplate_CreateBuildPublish_IndividualAuthNoLocalDb running first [Theory] [InlineData(BrowserKind.Chromium)] diff --git a/src/ProjectTemplates/Shared/AspNetProcess.cs b/src/ProjectTemplates/Shared/AspNetProcess.cs index 852e3183567a..fb232812b8d5 100644 --- a/src/ProjectTemplates/Shared/AspNetProcess.cs +++ b/src/ProjectTemplates/Shared/AspNetProcess.cs @@ -112,7 +112,6 @@ public async Task VisitInBrowserAsync(IPage page) await page.GotoAsync(ListeningUri.AbsoluteUri); } - public async Task AssertPagesOk(IEnumerable pages) { foreach (var page in pages) diff --git a/src/ProjectTemplates/test/RazorPagesTemplateTest.cs b/src/ProjectTemplates/test/RazorPagesTemplateTest.cs index 43713b713e20..4534c6642692 100644 --- a/src/ProjectTemplates/test/RazorPagesTemplateTest.cs +++ b/src/ProjectTemplates/test/RazorPagesTemplateTest.cs @@ -252,7 +252,6 @@ private async Task BuildAndPublishRazorPagesTemplate(string auth, strin return project; } - private string ReadFile(string basePath, string path) { var fullPath = Path.Combine(basePath, path); diff --git a/src/ProjectTemplates/test/WebApiTemplateTest.cs b/src/ProjectTemplates/test/WebApiTemplateTest.cs index 01931bb6aa7b..6d3889bce694 100644 --- a/src/ProjectTemplates/test/WebApiTemplateTest.cs +++ b/src/ProjectTemplates/test/WebApiTemplateTest.cs @@ -121,7 +121,6 @@ private async Task WebApiTemplateCore(string languageOverride) aspNetProcess.Process.HasExited, ErrorMessages.GetFailedProcessMessageOrEmpty("Run published project", project, aspNetProcess.Process)); - await aspNetProcess.AssertOk("weatherforecast"); // Swagger is only available in Development await aspNetProcess.AssertNotFound("swagger"); diff --git a/src/Razor/Razor.Runtime/test/Runtime/TagHelpers/TestTagHelpers/TagHelperDescriptorFactoryTagHelpers.cs b/src/Razor/Razor.Runtime/test/Runtime/TagHelpers/TestTagHelpers/TagHelperDescriptorFactoryTagHelpers.cs index 13eadab95506..2f1589f05831 100644 --- a/src/Razor/Razor.Runtime/test/Runtime/TagHelpers/TestTagHelpers/TagHelperDescriptorFactoryTagHelpers.cs +++ b/src/Razor/Razor.Runtime/test/Runtime/TagHelpers/TestTagHelpers/TagHelperDescriptorFactoryTagHelpers.cs @@ -41,7 +41,6 @@ public class MultiWithUnspecifiedRequiredParentTagHelper : TagHelper { } - [RestrictChildren("p")] public class RestrictChildrenTagHelper { diff --git a/src/Razor/Razor/test/TagHelpers/DefaultTagHelperContentTest.cs b/src/Razor/Razor/test/TagHelpers/DefaultTagHelperContentTest.cs index 5aef4b3e112a..48ecb5f71a7b 100644 --- a/src/Razor/Razor/test/TagHelpers/DefaultTagHelperContentTest.cs +++ b/src/Razor/Razor/test/TagHelpers/DefaultTagHelperContentTest.cs @@ -313,7 +313,6 @@ public void IsModified_TrueAfterSetContent() Assert.True(tagHelperContent.IsModified); } - [Fact] public void IsModified_TrueAfterAppend() { diff --git a/src/Razor/Razor/test/TagHelpers/ReadOnlyTagHelperAttributeListTest.cs b/src/Razor/Razor/test/TagHelpers/ReadOnlyTagHelperAttributeListTest.cs index 7dcd853b417a..f32e6a466d47 100644 --- a/src/Razor/Razor/test/TagHelpers/ReadOnlyTagHelperAttributeListTest.cs +++ b/src/Razor/Razor/test/TagHelpers/ReadOnlyTagHelperAttributeListTest.cs @@ -687,7 +687,6 @@ public void ModifyingUnderlyingAttributes_AffectsExposedAttributes() Assert.Equal(attributes, expectedAttributes, CaseSensitiveTagHelperAttributeComparer.Default); } - [Theory] [MemberData(nameof(IntIndexerData))] public void ModifyingUnderlyingAttributes_IntIndexer_ReturnsExpectedResult( diff --git a/src/Security/Authentication/Core/src/RemoteAuthenticationHandler.cs b/src/Security/Authentication/Core/src/RemoteAuthenticationHandler.cs index 5c97af0ab728..9f42aecf406a 100644 --- a/src/Security/Authentication/Core/src/RemoteAuthenticationHandler.cs +++ b/src/Security/Authentication/Core/src/RemoteAuthenticationHandler.cs @@ -47,7 +47,6 @@ public abstract class RemoteAuthenticationHandler : AuthenticationHand protected RemoteAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock) { } - /// protected override Task CreateEventsAsync() => Task.FromResult(new RemoteAuthenticationEvents()); diff --git a/src/Security/Authentication/samples/SocialSample/Startup.cs b/src/Security/Authentication/samples/SocialSample/Startup.cs index 624f23be4447..88694a81b0c1 100644 --- a/src/Security/Authentication/samples/SocialSample/Startup.cs +++ b/src/Security/Authentication/samples/SocialSample/Startup.cs @@ -419,7 +419,6 @@ public void Configure(IApplicationBuilder app) }); }); - app.Run(async context => { // Setting DefaultAuthenticateScheme causes User to be set diff --git a/src/Security/Authentication/test/CertificateTests.cs b/src/Security/Authentication/test/CertificateTests.cs index 75d321fe5140..7737eac3e175 100644 --- a/src/Security/Authentication/test/CertificateTests.cs +++ b/src/Security/Authentication/test/CertificateTests.cs @@ -804,7 +804,6 @@ private static async Task CreateHost( return next(context); }); - if (wireUpHeaderMiddleware) { app.UseCertificateForwarding(); diff --git a/src/Security/Authentication/test/OpenIdConnect/OpenIdConnectChallengeTests.cs b/src/Security/Authentication/test/OpenIdConnect/OpenIdConnectChallengeTests.cs index 64a0f6570235..1870cc7f75d4 100644 --- a/src/Security/Authentication/test/OpenIdConnect/OpenIdConnectChallengeTests.cs +++ b/src/Security/Authentication/test/OpenIdConnect/OpenIdConnectChallengeTests.cs @@ -281,7 +281,6 @@ public async Task OnRedirectToIdentityProviderEventIsHit() OpenIdConnectParameterNames.RedirectUri); } - [Fact] public async Task OnRedirectToIdentityProviderEventCanReplaceValues() { diff --git a/src/Security/Authentication/test/RemoteAuthenticationTests.cs b/src/Security/Authentication/test/RemoteAuthenticationTests.cs index 65a4fc3a1385..51b736c9c0d7 100644 --- a/src/Security/Authentication/test/RemoteAuthenticationTests.cs +++ b/src/Security/Authentication/test/RemoteAuthenticationTests.cs @@ -26,7 +26,6 @@ private Task CreateHost(Action configureOptions, Func(Clock); }, testpath); - protected virtual async Task CreateHostWithServices(Action configureServices, Func testpath = null) { var host = new HostBuilder() diff --git a/src/Security/Authorization/test/DefaultAuthorizationServiceTests.cs b/src/Security/Authorization/test/DefaultAuthorizationServiceTests.cs index dea5a368f7a1..937adbc55eaa 100644 --- a/src/Security/Authorization/test/DefaultAuthorizationServiceTests.cs +++ b/src/Security/Authorization/test/DefaultAuthorizationServiceTests.cs @@ -1159,7 +1159,6 @@ public async Task CanUseCustomEvaluatorThatOverridesRequirement() Assert.True(result.Succeeded); } - public class BadContextMaker : IAuthorizationHandlerContextFactory { public AuthorizationHandlerContext CreateContext(IEnumerable requirements, ClaimsPrincipal user, object resource) diff --git a/src/Security/Authorization/test/PolicyEvaluatorTests.cs b/src/Security/Authorization/test/PolicyEvaluatorTests.cs index ba7b69c2867e..6937eafc108a 100644 --- a/src/Security/Authorization/test/PolicyEvaluatorTests.cs +++ b/src/Security/Authorization/test/PolicyEvaluatorTests.cs @@ -65,7 +65,6 @@ public async Task AuthenticateMergeSchemesPreservesSingleScheme() Assert.Equal(auth.Principal, result.Principal); } - [Fact] public async Task AuthorizeSucceedsEvenIfAuthenticationFails() { diff --git a/src/Security/CookiePolicy/test/CookieChunkingTests.cs b/src/Security/CookiePolicy/test/CookieChunkingTests.cs index fd550f474199..59f7f5a8ecd4 100644 --- a/src/Security/CookiePolicy/test/CookieChunkingTests.cs +++ b/src/Security/CookiePolicy/test/CookieChunkingTests.cs @@ -145,8 +145,6 @@ public void DeleteChunkedCookieWithOptions_AllDeleted() }, cookies); } - - [Fact] public void DeleteChunkedCookieWithOptionsAndResponseCookies_AllDeleted() { diff --git a/src/Security/perf/Microbenchmarks/ChunkingCookieManagerBenchmark.cs b/src/Security/perf/Microbenchmarks/ChunkingCookieManagerBenchmark.cs index 7b2d14f820f6..007010d26324 100644 --- a/src/Security/perf/Microbenchmarks/ChunkingCookieManagerBenchmark.cs +++ b/src/Security/perf/Microbenchmarks/ChunkingCookieManagerBenchmark.cs @@ -48,7 +48,6 @@ public void GlobalSetup() _stringToAdd = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; } - [Benchmark] public void AppendCookies() { diff --git a/src/Security/samples/PathSchemeSelection/Startup.cs b/src/Security/samples/PathSchemeSelection/Startup.cs index c55f03973c60..e79064cfb242 100644 --- a/src/Security/samples/PathSchemeSelection/Startup.cs +++ b/src/Security/samples/PathSchemeSelection/Startup.cs @@ -62,7 +62,6 @@ protected override Task HandleAuthenticateAsync() => Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_id, "Api"))); } - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { diff --git a/src/Security/test/AuthSamples.FunctionalTests/PathSchemeSelectionTests.cs b/src/Security/test/AuthSamples.FunctionalTests/PathSchemeSelectionTests.cs index cfd3aa582846..4c0b923c1b50 100644 --- a/src/Security/test/AuthSamples.FunctionalTests/PathSchemeSelectionTests.cs +++ b/src/Security/test/AuthSamples.FunctionalTests/PathSchemeSelectionTests.cs @@ -41,7 +41,6 @@ public async Task ApiDefaultReturns200() Assert.Equal(HttpStatusCode.OK, response.StatusCode); } - [Fact] public async Task MyClaimsRedirectsToLoginPageWhenNotLoggedIn() { diff --git a/src/Servers/Connections.Abstractions/src/DefaultConnectionContext.cs b/src/Servers/Connections.Abstractions/src/DefaultConnectionContext.cs index b25db8398337..da2449ae21f5 100644 --- a/src/Servers/Connections.Abstractions/src/DefaultConnectionContext.cs +++ b/src/Servers/Connections.Abstractions/src/DefaultConnectionContext.cs @@ -55,7 +55,6 @@ public DefaultConnectionContext(string id) ConnectionClosed = _connectionClosedTokenSource.Token; } - /// /// Creates the DefaultConnectionContext with the given and pipes. /// diff --git a/src/Servers/HttpSys/src/AuthenticationSchemes.cs b/src/Servers/HttpSys/src/AuthenticationSchemes.cs index 8ddf4cd2bdff..521240c61262 100644 --- a/src/Servers/HttpSys/src/AuthenticationSchemes.cs +++ b/src/Servers/HttpSys/src/AuthenticationSchemes.cs @@ -19,7 +19,6 @@ public enum AuthenticationSchemes /// Basic = 0x1, - // Digest = 0x2, // TODO: Verify this is no longer supported by Http.Sys /// diff --git a/src/Servers/HttpSys/src/IHttpSysRequestInfoFeature.cs b/src/Servers/HttpSys/src/IHttpSysRequestInfoFeature.cs index 28effeebfc03..d52caa1afc5b 100644 --- a/src/Servers/HttpSys/src/IHttpSysRequestInfoFeature.cs +++ b/src/Servers/HttpSys/src/IHttpSysRequestInfoFeature.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - // Note: This will also be useful for IIS in-proc. // Plan: Have Microsoft.AspNetCore.Server.IIS take a dependency on Microsoft.AspNetCore.Server.HttpSys and implement this interface. namespace Microsoft.AspNetCore.Server.HttpSys; diff --git a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs index 2686deb5799e..fe3aa0c501fe 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs @@ -125,7 +125,6 @@ protected internal void InitializeFeatures() _responseHeaders = Response.Headers; } - private bool IsNotInitialized(Fields field) { return (_initializedFields & field) != field; diff --git a/src/Servers/HttpSys/test/FunctionalTests/RequestBodyTests.cs b/src/Servers/HttpSys/test/FunctionalTests/RequestBodyTests.cs index 506d8008b882..bc2d77e26450 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/RequestBodyTests.cs +++ b/src/Servers/HttpSys/test/FunctionalTests/RequestBodyTests.cs @@ -194,7 +194,6 @@ public async Task RequestBody_ChangeContentLength_Success() } } - [ConditionalFact] public async Task RequestBody_RemoveHeaderOnEmptyValueSet_Success() { diff --git a/src/Servers/IIS/IIS/src/StartupHook.cs b/src/Servers/IIS/IIS/src/StartupHook.cs index 3ff4bc60cc25..d34175404ed4 100644 --- a/src/Servers/IIS/IIS/src/StartupHook.cs +++ b/src/Servers/IIS/IIS/src/StartupHook.cs @@ -5,7 +5,6 @@ using Microsoft.AspNetCore.Server.IIS; using Microsoft.Extensions.FileProviders; - /// /// Startup hooks are pieces of code that will run before a users program main executes /// See: https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/host-startup-hook.md diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Infrastructure/Helpers.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Infrastructure/Helpers.cs index b7c582e8bd57..af3e945d1f54 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Infrastructure/Helpers.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Infrastructure/Helpers.cs @@ -159,7 +159,6 @@ public static void AssertWorkerProcessStop(this IISDeploymentResult deploymentRe } } - public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func verificationAction = null) { if (deploymentResult.DeploymentParameters.HostingModel != HostingModel.InProcess) diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/RequestResponseTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/RequestResponseTests.cs index 48ec1f11318a..b40b82e624ed 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/RequestResponseTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/RequestResponseTests.cs @@ -439,7 +439,6 @@ await Helpers.StressLoad(_fixture.Client, "/GetServerVariableStress", response = }); } - [ConditionalFact] public async Task TestReadOffsetWorks() { @@ -503,7 +502,6 @@ public async Task TestValidWriteOperationsPost() Assert.Equal("Success", await result.Content.ReadAsStringAsync()); } - [ConditionalFact] public async Task AddEmptyHeaderSkipped() { @@ -546,7 +544,6 @@ public async Task ErrorCodeIsSetForExceptionDuringRequest() [InlineData(200, "custom", "custom", "Custom body")] [InlineData(200, "custom", "custom", "")] - [InlineData(500, "", "Internal Server Error", null)] [InlineData(500, "", "Internal Server Error", "Custom body")] [InlineData(500, "", "Internal Server Error", "")] diff --git a/src/Servers/IIS/IIS/test/Common.LongTests/ShutdownTests.cs b/src/Servers/IIS/IIS/test/Common.LongTests/ShutdownTests.cs index 50b93cc49a27..55a93ce5a0f4 100644 --- a/src/Servers/IIS/IIS/test/Common.LongTests/ShutdownTests.cs +++ b/src/Servers/IIS/IIS/test/Common.LongTests/ShutdownTests.cs @@ -81,7 +81,6 @@ public async Task CallStopAsyncOnRequestThread_DoesNotHangIndefinitely(string pa deploymentResult.AssertWorkerProcessStop(); } - [ConditionalFact] public async Task AppOfflineDroppedWhileSiteIsDown_SiteReturns503_InProcess() { diff --git a/src/Servers/IIS/IIS/test/Common.LongTests/StartupTests.cs b/src/Servers/IIS/IIS/test/Common.LongTests/StartupTests.cs index 188b13c5360b..b0597655a085 100644 --- a/src/Servers/IIS/IIS/test/Common.LongTests/StartupTests.cs +++ b/src/Servers/IIS/IIS/test/Common.LongTests/StartupTests.cs @@ -649,7 +649,6 @@ public static Dictionary> InitPort return dictionary; } - private static Dictionary> StandaloneConfigTransformations = InitStandaloneConfigTransformations(); public static IEnumerable StandaloneConfigTransformationsScenarios => StandaloneConfigTransformations.ToTheoryData(); @@ -865,7 +864,6 @@ public async Task ExceptionIsLoggedToEventLogDoesNotWriteToResponse() VerifyDotnetRuntimeEventLog(deploymentResult); } - [ConditionalFact] [RequiresNewHandler] public async Task CanAddCustomStartupHook() @@ -975,7 +973,6 @@ public async Task OnCompletedDoesNotFailRequest() } } - [ConditionalTheory] [InlineData("CheckLargeStdErrWrites")] [InlineData("CheckLargeStdOutWrites")] @@ -1140,7 +1137,6 @@ public async Task IncludesAdditionalErrorPageTextInProcessStartupFailure_Correct await AssertLink(response); } - [ConditionalFact] public async Task GetLongEnvironmentVariable_InProcess() { @@ -1151,7 +1147,6 @@ public async Task GetLongEnvironmentVariable_InProcess() "AReallyLongValueThatIsGreaterThan300CharactersToForceResizeInNative" + "AReallyLongValueThatIsGreaterThan300CharactersToForceResizeInNative"; - var deploymentParameters = Fixture.GetBaseDeploymentParameters(HostingModel.InProcess); deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_INPROCESS_TESTING_LONG_VALUE"] = expectedValue; @@ -1171,7 +1166,6 @@ public async Task GetLongEnvironmentVariable_OutOfProcess() "AReallyLongValueThatIsGreaterThan300CharactersToForceResizeInNative" + "AReallyLongValueThatIsGreaterThan300CharactersToForceResizeInNative"; - var deploymentParameters = Fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess); deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_INPROCESS_TESTING_LONG_VALUE"] = expectedValue; diff --git a/src/Servers/IIS/IIS/test/IIS.FunctionalTests/Http2TrailersResetTests.cs b/src/Servers/IIS/IIS/test/IIS.FunctionalTests/Http2TrailersResetTests.cs index 8280499a017c..0ed30f30e57a 100644 --- a/src/Servers/IIS/IIS/test/IIS.FunctionalTests/Http2TrailersResetTests.cs +++ b/src/Servers/IIS/IIS/test/IIS.FunctionalTests/Http2TrailersResetTests.cs @@ -39,7 +39,6 @@ public Http2TrailerResetTests(IISTestSiteFixture fixture) public IISTestSiteFixture Fixture { get; } - [ConditionalFact] [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers)] public async Task ResponseTrailers_HTTP2_TrailersAvailable() @@ -369,7 +368,6 @@ public async Task Reset_DuringResponseBody_Resets() .Build().RunAsync(); } - [ConditionalFact] [RequiresNewHandler] [MinimumOSVersion(OperatingSystems.Windows, WindowsVersionForTrailers)] diff --git a/src/Servers/IIS/IIS/test/IIS.ShadowCopy.Tests/ShadowCopyTests.cs b/src/Servers/IIS/IIS/test/IIS.ShadowCopy.Tests/ShadowCopyTests.cs index 005e4da3600d..fc67726d34e1 100644 --- a/src/Servers/IIS/IIS/test/IIS.ShadowCopy.Tests/ShadowCopyTests.cs +++ b/src/Servers/IIS/IIS/test/IIS.ShadowCopy.Tests/ShadowCopyTests.cs @@ -251,7 +251,6 @@ public async Task ShadowCopyCleansUpOlderFolders() Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "3")), "Expected 3 shadow copy directory to be deleted"); } - [ConditionalFact] public async Task ShadowCopyIgnoresItsOwnDirectoryWithRelativePathSegmentWhenCopying() { diff --git a/src/Servers/IIS/IIS/test/IIS.Tests/MaxRequestBodySizeTests.cs b/src/Servers/IIS/IIS/test/IIS.Tests/MaxRequestBodySizeTests.cs index 071060578e49..a8e348e5bb10 100644 --- a/src/Servers/IIS/IIS/test/IIS.Tests/MaxRequestBodySizeTests.cs +++ b/src/Servers/IIS/IIS/test/IIS.Tests/MaxRequestBodySizeTests.cs @@ -227,7 +227,6 @@ await connection.Send( } } - [ConditionalFact] public async Task SettingMaxRequestBodySizeAfterReadingFromRequestBodyThrows() { diff --git a/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/IISExpressShutdownTests.cs b/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/IISExpressShutdownTests.cs index 906349d6c6c0..17e97304a964 100644 --- a/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/IISExpressShutdownTests.cs +++ b/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/IISExpressShutdownTests.cs @@ -40,7 +40,6 @@ public async Task ServerShutsDownWhenMainExits() deploymentResult.AssertWorkerProcessStop(); } - [ConditionalFact] public async Task ServerShutsDownWhenMainExitsStress() { diff --git a/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Program.cs b/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Program.cs index 9a6d9fa155be..8ae69750afc0 100644 --- a/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Program.cs +++ b/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Program.cs @@ -159,7 +159,6 @@ public static int Main(string[] args) .UseStartup(); }); - host.Build().Run(); return 0; } diff --git a/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs b/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs index abf7a5341e64..9dc7d6c155fa 100644 --- a/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs +++ b/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs @@ -762,7 +762,6 @@ private async Task TestInvalidReadOperations(HttpContext ctx) } } - await ctx.Response.WriteAsync(success ? "Success" : "Failure"); } diff --git a/src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs b/src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs index 963cf20117b4..927222da0feb 100644 --- a/src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs +++ b/src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs @@ -90,7 +90,6 @@ public override async Task DeployAsync() RunWebConfigActions(contentRoot); - // Launch the host process. var (actualUri, hostExitToken) = await StartIISExpressAsync(contentRoot); diff --git a/src/Servers/Kestrel/Core/src/Internal/ConfigurationReader.cs b/src/Servers/Kestrel/Core/src/Internal/ConfigurationReader.cs index 3b4bd5682a41..7af930b47db1 100644 --- a/src/Servers/Kestrel/Core/src/Internal/ConfigurationReader.cs +++ b/src/Servers/Kestrel/Core/src/Internal/ConfigurationReader.cs @@ -162,7 +162,6 @@ private static Dictionary ReadSni(IConfigurationSection sniCo return sniDictionary; } - private static ClientCertificateMode? ParseClientCertificateMode(string? clientCertificateMode) { if (Enum.TryParse(clientCertificateMode, ignoreCase: true, out var result)) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs index 298c16dd8a55..a27fe898ce92 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs @@ -654,7 +654,6 @@ private async Task ProcessRequests(IHttpApplication applicat InitializeBodyControl(messageBody); - var context = application.CreateContext(this); try diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseStream.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseStream.cs index 9d8599f92a0b..e720c791a026 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseStream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseStream.cs @@ -66,13 +66,10 @@ public override long Seek(long offset, SeekOrigin origin) throw new NotSupportedException(); } - public override void SetLength(long value) { throw new NotSupportedException(); } - - public override void Write(byte[] buffer, int offset, int count) { if (!_bodyControl.AllowSynchronousIO) @@ -82,7 +79,6 @@ public override void Write(byte[] buffer, int offset, int count) WriteAsync(buffer, offset, count, default).GetAwaiter().GetResult(); } - public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state) { return TaskToApm.Begin(WriteAsync(buffer, offset, count), callback, state); @@ -97,7 +93,6 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati { return _pipeWriter.WriteAsync(new ReadOnlyMemory(buffer, offset, count), cancellationToken).GetAsTask(); } - public override ValueTask WriteAsync(ReadOnlyMemory source, CancellationToken cancellationToken = default) { return _pipeWriter.WriteAsync(source, cancellationToken).GetAsValueTask(); diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3OutputProducer.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3OutputProducer.cs index cf08820d536d..e0e07255aba7 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3OutputProducer.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3OutputProducer.cs @@ -196,7 +196,6 @@ public Memory GetMemory(int sizeHint = 0) } } - public Span GetSpan(int sizeHint = 0) { lock (_dataWriterLock) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs index 929be16c4dad..ba6f46d9fbf9 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs @@ -989,7 +989,6 @@ private bool TryValidatePseudoHeaders() return TryValidatePath(pathSegment); } - private bool TryValidateMethod() { // :method diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/QPack/EncoderStreamReader.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/QPack/EncoderStreamReader.cs index fb08a275780e..1552a5cdbe05 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http3/QPack/EncoderStreamReader.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http3/QPack/EncoderStreamReader.cs @@ -31,7 +31,6 @@ private enum State private const byte DynamicTableCapacityPrefixMask = 0x1F; private const int DynamicTableCapacityPrefix = 5; - //0 1 2 3 4 5 6 7 //+---+---+---+---+---+---+---+---+ //| 1 | S | Name Index(6+) | @@ -240,7 +239,6 @@ private void OnByte(byte b) } } - private void OnStringLength(int length, State nextState) { if (length > _stringOctets.Length) diff --git a/src/Servers/Kestrel/Core/src/Middleware/HttpsConnectionMiddleware.cs b/src/Servers/Kestrel/Core/src/Middleware/HttpsConnectionMiddleware.cs index 382a9f643e0a..439da6460f33 100644 --- a/src/Servers/Kestrel/Core/src/Middleware/HttpsConnectionMiddleware.cs +++ b/src/Servers/Kestrel/Core/src/Middleware/HttpsConnectionMiddleware.cs @@ -192,7 +192,6 @@ public async Task OnConnectionAsync(ConnectionContext context) return; } - KestrelEventSource.Log.TlsHandshakeStop(context, feature); _logger.HttpsConnectionEstablished(context.ConnectionId, sslStream.SslProtocol); diff --git a/src/Servers/Kestrel/Core/test/Http1/Http1ConnectionTests.cs b/src/Servers/Kestrel/Core/test/Http1/Http1ConnectionTests.cs index 25d6961a0279..01b8985b09f0 100644 --- a/src/Servers/Kestrel/Core/test/Http1/Http1ConnectionTests.cs +++ b/src/Servers/Kestrel/Core/test/Http1/Http1ConnectionTests.cs @@ -970,7 +970,6 @@ public void BadRequestFor11BadHostHeaderFormat() Assert.Equal(CoreStrings.FormatBadRequest_InvalidHostHeader_Detail("a=b"), ex.Message); } - private bool TakeMessageHeaders(ReadOnlySequence readableBuffer, bool trailers, out SequencePosition consumed, out SequencePosition examined) { var reader = new SequenceReader(readableBuffer); diff --git a/src/Servers/Kestrel/Core/test/HttpParserTests.cs b/src/Servers/Kestrel/Core/test/HttpParserTests.cs index a2e392c39946..e6898927d644 100644 --- a/src/Servers/Kestrel/Core/test/HttpParserTests.cs +++ b/src/Servers/Kestrel/Core/test/HttpParserTests.cs @@ -452,7 +452,6 @@ public void ParseHeadersWithGratuitouslySplitBuffers2() Assert.True(result); } - private bool ParseRequestLine(IHttpParser parser, RequestHandler requestHandler, ReadOnlySequence readableBuffer, out SequencePosition consumed, out SequencePosition examined) { var reader = new SequenceReader(readableBuffer); diff --git a/src/Servers/Kestrel/Core/test/HttpUtilitiesTest.cs b/src/Servers/Kestrel/Core/test/HttpUtilitiesTest.cs index dd740f871437..ff1483952729 100644 --- a/src/Servers/Kestrel/Core/test/HttpUtilitiesTest.cs +++ b/src/Servers/Kestrel/Core/test/HttpUtilitiesTest.cs @@ -44,7 +44,6 @@ public void GetsKnownMethod(string input, bool expectedResult, string expectedKn toString = HttpUtilities.MethodToString(knownMethod); } - // Assert Assert.Equal(expectedResult, result); Assert.Equal(expectedMethod, knownMethod); diff --git a/src/Servers/Kestrel/Core/test/KestrelServerLimitsTests.cs b/src/Servers/Kestrel/Core/test/KestrelServerLimitsTests.cs index 9ef117e68733..e984a1fd3de3 100644 --- a/src/Servers/Kestrel/Core/test/KestrelServerLimitsTests.cs +++ b/src/Servers/Kestrel/Core/test/KestrelServerLimitsTests.cs @@ -251,7 +251,6 @@ public void MaxUpgradedConnectionsValid(long? value) Assert.Equal(value, limits.MaxConcurrentUpgradedConnections); } - [Theory] [InlineData(long.MinValue)] [InlineData(-1)] diff --git a/src/Servers/Kestrel/Core/test/MessageBodyTests.cs b/src/Servers/Kestrel/Core/test/MessageBodyTests.cs index 256321fc8409..f0e9dd29ea77 100644 --- a/src/Servers/Kestrel/Core/test/MessageBodyTests.cs +++ b/src/Servers/Kestrel/Core/test/MessageBodyTests.cs @@ -484,7 +484,6 @@ public async Task ReadFromNoContentLengthReturnsZero(int intHttpVersion) var buffer = new byte[1024]; Assert.Equal(0, stream.Read(buffer, 0, buffer.Length)); - await body.StopAsync(); } } @@ -507,7 +506,6 @@ public async Task ReadAsyncFromNoContentLengthReturnsZero(int intHttpVersion) var buffer = new byte[1024]; Assert.Equal(0, await stream.ReadAsync(buffer, 0, buffer.Length)); - await body.StopAsync(); } } @@ -537,7 +535,6 @@ public async Task CanHandleLargeBlocks() Assert.Equal(8197, requestArray.Length); AssertASCII(largeInput + "Hello", new ArraySegment(requestArray, 0, requestArray.Length)); - await body.StopAsync(); } } diff --git a/src/Servers/Kestrel/Core/test/SniOptionsSelectorTests.cs b/src/Servers/Kestrel/Core/test/SniOptionsSelectorTests.cs index 929ac1ce11b5..99b228079511 100644 --- a/src/Servers/Kestrel/Core/test/SniOptionsSelectorTests.cs +++ b/src/Servers/Kestrel/Core/test/SniOptionsSelectorTests.cs @@ -582,7 +582,6 @@ public void FallsBackToFallbackSslProtocols() Assert.Equal(SslProtocols.Tls13, options.EnabledSslProtocols); } - [Fact] public void PrefersClientCertificateModeDefinedInSniConfig() { diff --git a/src/Servers/Kestrel/Core/test/TimeoutControlTests.cs b/src/Servers/Kestrel/Core/test/TimeoutControlTests.cs index b03ef60fbe7a..4d40887d8a7c 100644 --- a/src/Servers/Kestrel/Core/test/TimeoutControlTests.cs +++ b/src/Servers/Kestrel/Core/test/TimeoutControlTests.cs @@ -38,7 +38,6 @@ public void DoesNotTimeOutWhenDebuggerIsAttached() _mockTimeoutHandler.Verify(h => h.OnTimeout(It.IsAny()), Times.Never); } - [Fact] public void DoesNotTimeOutWhenRequestBodyDoesNotSatisfyMinimumDataRateButDebuggerIsAttached() { @@ -152,7 +151,6 @@ public void RequestBodyDataRateIsAveragedOverTimeSpentReadingRequestBody() _mockTimeoutHandler.Verify(h => h.OnTimeout(TimeoutReason.ReadDataRate), Times.Once); } - [Fact] public void RequestBodyDataRateNotComputedOnPausedTime() { diff --git a/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs b/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs index 986eb4c2fe25..27ea07e4a6f7 100644 --- a/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs +++ b/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs @@ -855,7 +855,6 @@ public void EndpointConfigureSection_CanSetClientCertificateMode() Assert.True(ran2); } - [Fact] public void EndpointConfigureSection_CanConfigureSni() { diff --git a/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicLog.cs b/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicLog.cs index d3d0f813ff12..d80fe799a2ab 100644 --- a/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicLog.cs +++ b/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicLog.cs @@ -184,5 +184,3 @@ private enum StreamType Bidirectional } } - - diff --git a/src/Servers/Kestrel/perf/Microbenchmarks/HeaderCollectionBenchmark.cs b/src/Servers/Kestrel/perf/Microbenchmarks/HeaderCollectionBenchmark.cs index 008827d3432c..67f1a4e90ed5 100644 --- a/src/Servers/Kestrel/perf/Microbenchmarks/HeaderCollectionBenchmark.cs +++ b/src/Servers/Kestrel/perf/Microbenchmarks/HeaderCollectionBenchmark.cs @@ -308,7 +308,6 @@ string ReadHeaders() value = headers.Server; value = headers.ContentType; - value = headers.Link; value = headers.XUACompatible; value = headers.XPoweredBy; diff --git a/src/Servers/Kestrel/perf/Microbenchmarks/RequestParsingBenchmark.cs b/src/Servers/Kestrel/perf/Microbenchmarks/RequestParsingBenchmark.cs index 039e5bd10871..648ccce3a470 100644 --- a/src/Servers/Kestrel/perf/Microbenchmarks/RequestParsingBenchmark.cs +++ b/src/Servers/Kestrel/perf/Microbenchmarks/RequestParsingBenchmark.cs @@ -202,7 +202,6 @@ private void ParseData() while (true); } - [IterationCleanup] public void Cleanup() { diff --git a/src/Servers/Kestrel/shared/KnownHeaders.cs b/src/Servers/Kestrel/shared/KnownHeaders.cs index 0f104f305672..b2106bc9422c 100644 --- a/src/Servers/Kestrel/shared/KnownHeaders.cs +++ b/src/Servers/Kestrel/shared/KnownHeaders.cs @@ -337,7 +337,6 @@ static string AppendValue(bool returnTrue = false) => values = AppendValue(values, valueStr); }}"; - static string AppendIndexedSwitchSection(KnownHeader header) { if (header.Name == HeaderNames.ContentLength) diff --git a/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs b/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs index e69f6e7ef04f..dadfa49e46ab 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs @@ -60,7 +60,6 @@ public void TlsAndHttp2NotSupportedOnMac() Assert.Equal("HTTP/2 over TLS is not supported on macOS due to missing ALPN support.", ex.Message); } - [ConditionalFact] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [MaximumOSVersion(OperatingSystems.Windows, WindowsVersions.Win7)] diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ChunkedRequestTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ChunkedRequestTests.cs index 5dbd5ea8327a..46a364c586de 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ChunkedRequestTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ChunkedRequestTests.cs @@ -746,7 +746,6 @@ await connection.ReceiveEnd( } } - [Fact] public async Task ChunkedNotFinalTransferCodingResultsIn400() { diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs index ef2d7cd360dd..ea6878699eaf 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs @@ -862,7 +862,6 @@ await InitializeConnectionAsync(async context => Assert.Equal(12, total); }); - await StartStreamAsync(1, headers, endStream: false); await SendDataAsync(1, new byte[1], endStream: false); await SendDataAsync(1, new byte[3], endStream: false); @@ -3493,7 +3492,6 @@ await InitializeConnectionAsync(async httpContext => { var response = httpContext.Response; - var memory = response.BodyWriter.GetMemory(4096); var fisrtPartOfResponse = Encoding.ASCII.GetBytes("hello,"); fisrtPartOfResponse.CopyTo(memory); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs index 5c223b11c107..b7d6b7a47535 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs @@ -1378,7 +1378,6 @@ public virtual void CancelTimeout() _realTimeoutControl.CancelTimeout(); } - public virtual void InitializeHttp2(InputFlowControl connectionInputFlowControl) { _realTimeoutControl.InitializeHttp2(connectionInputFlowControl); @@ -1409,7 +1408,6 @@ public virtual void BytesRead(long count) _realTimeoutControl.BytesRead(count); } - public virtual void StartTimingWrite() { _realTimeoutControl.StartTimingWrite(); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3ConnectionTests.cs index 4c0cb6b28f95..6b513009350e 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3ConnectionTests.cs @@ -463,7 +463,6 @@ await Http3Api.InitializeConnectionAsync(context => return Task.CompletedTask; }); - for (int i = 0; i < 3; i++) { var requestStream = await Http3Api.CreateRequestStream(); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs index 1f7dac6f1356..1756a3ba940c 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs @@ -971,7 +971,6 @@ void ConfigureListenOptions(ListenOptions listenOptions) }); } - await using (var server = new TestServer(context => context.Response.WriteAsync("hello world"), new TestServiceContext(LoggerFactory), ConfigureListenOptions)) { // SslStream is used to ensure the certificate is actually passed to the server diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs index c6a92bc3e248..5211b9246836 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs @@ -1586,7 +1586,6 @@ await connection.ReceiveEnd( } } - [Fact] public async Task DoesNotEnforceRequestBodyMinimumDataRateOnUpgradedRequest() { diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs index dd0a36ccca06..66816b838343 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs @@ -559,7 +559,6 @@ await connection.Send( "", ""); - var ex = await Assert.ThrowsAsync(() => responseWriteTcs.Task).DefaultTimeout(); Assert.Equal(CoreStrings.FormatWritingToResponseBodyNotSupported(statusCode), ex.Message); @@ -602,7 +601,6 @@ await connection.Send( "", ""); - var ex = await Assert.ThrowsAsync(() => responseWriteTcs.Task).DefaultTimeout(); Assert.Equal(CoreStrings.FormatWritingToResponseBodyNotSupported(205), ex.Message); @@ -2198,7 +2196,6 @@ await connection.ReceiveEnd( Assert.Equal(2, LogMessages.Where(message => message.LogLevel == LogLevel.Error).Count()); } - [Fact] public async Task ThrowingInOnStartingResultsInFailedWritesAnd500Response() { @@ -2479,7 +2476,6 @@ await connection.ReceiveEnd( Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error); } - [Fact] public async Task NoErrorsLoggedWhenServerEndsConnectionBeforeClient() { diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/TestTransport/TestServer.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/TestTransport/TestServer.cs index 830993de07dd..a9e22498e3a1 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/TestTransport/TestServer.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/TestTransport/TestServer.cs @@ -120,7 +120,6 @@ public Task StopAsync(CancellationToken cancellationToken = default) return _host.StopAsync(cancellationToken); } - void IStartup.Configure(IApplicationBuilder app) { app.Run(_app); diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3RequestTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3RequestTests.cs index 0ee74671a614..360d72121125 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3RequestTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3RequestTests.cs @@ -554,7 +554,6 @@ public async Task POST_Expect100Continue_Get100Continue() } } - private static Version GetProtocol(HttpProtocols protocol) { switch (protocol) @@ -1081,7 +1080,6 @@ public async Task Get_CompleteAsyncAndReset_StreamNotPooled() request1.Version = HttpVersion.Version30; request1.VersionPolicy = HttpVersionPolicy.RequestVersionExact; - // TODO: There is a race between CompleteAsync and Reset. // https://github.com/dotnet/aspnetcore/issues/34915 try diff --git a/src/Shared/ActivatorUtilities/ActivatorUtilities.cs b/src/Shared/ActivatorUtilities/ActivatorUtilities.cs index 5ac3c5c927ae..37dbfb7c7b2a 100644 --- a/src/Shared/ActivatorUtilities/ActivatorUtilities.cs +++ b/src/Shared/ActivatorUtilities/ActivatorUtilities.cs @@ -125,7 +125,6 @@ public static T CreateInstance(IServiceProvider provider, params object[] par return (T)CreateInstance(provider, typeof(T), parameters); } - /// /// Retrieve an instance of the given type from the service provider. If one is not found then instantiate it directly. /// diff --git a/src/Shared/Buffers.MemoryPool/DiagnosticPoolBlock.cs b/src/Shared/Buffers.MemoryPool/DiagnosticPoolBlock.cs index b7b092c3ba68..8c3ebce812b4 100644 --- a/src/Shared/Buffers.MemoryPool/DiagnosticPoolBlock.cs +++ b/src/Shared/Buffers.MemoryPool/DiagnosticPoolBlock.cs @@ -28,7 +28,6 @@ internal sealed class DiagnosticPoolBlock : MemoryManager private bool _isDisposed; private int _pinCount; - /// /// This object cannot be instantiated outside of the static Create method /// diff --git a/src/Shared/CertificateGeneration/CertificateManager.cs b/src/Shared/CertificateGeneration/CertificateManager.cs index e5d6be0bae89..d4cbc1bc3e4b 100644 --- a/src/Shared/CertificateGeneration/CertificateManager.cs +++ b/src/Shared/CertificateGeneration/CertificateManager.cs @@ -812,7 +812,6 @@ public class CertificateManagerEventSource : EventSource [Event(9, Level = EventLevel.Verbose, Message = "Excluded certificates: {0}")] public void ExcludedCertificates(string excludedCertificates) => WriteEvent(9, excludedCertificates); - [Event(14, Level = EventLevel.Verbose, Message = "Valid certificates: {0}")] public void ValidCertificatesFound(string certificates) => WriteEvent(14, certificates); @@ -822,7 +821,6 @@ public class CertificateManagerEventSource : EventSource [Event(16, Level = EventLevel.Verbose, Message = "No valid certificates found.")] public void NoValidCertificatesFound() => WriteEvent(16); - [Event(17, Level = EventLevel.Verbose, Message = "Generating HTTPS development certificate.")] public void CreateDevelopmentCertificateStart() => WriteEvent(17); @@ -889,7 +887,6 @@ public class CertificateManagerEventSource : EventSource [Event(38, Level = EventLevel.Verbose, Message = "The certificate is not trusted: {0}.")] public void MacOSCertificateUntrusted(string certificate) => WriteEvent(38, certificate); - [Event(39, Level = EventLevel.Verbose, Message = "Removing the certificate from the keychain {0} {1}.")] public void MacOSRemoveCertificateFromKeyChainStart(string keyChain, string certificate) => WriteEvent(39, keyChain, certificate); @@ -899,7 +896,6 @@ public class CertificateManagerEventSource : EventSource [Event(41, Level = EventLevel.Warning, Message = "An error has occurred while running the remove trust command: {0}.")] public void MacOSRemoveCertificateFromKeyChainError(int exitCode) => WriteEvent(41, exitCode); - [Event(42, Level = EventLevel.Verbose, Message = "Removing the certificate from the user store {0}.")] public void RemoveCertificateFromUserStoreStart(string certificate) => WriteEvent(42, certificate); @@ -909,7 +905,6 @@ public class CertificateManagerEventSource : EventSource [Event(44, Level = EventLevel.Error, Message = "An error has occurred while removing the certificate from the user store: {0}.")] public void RemoveCertificateFromUserStoreError(string error) => WriteEvent(44, error); - [Event(45, Level = EventLevel.Verbose, Message = "Adding certificate to the trusted root certification authority store.")] public void WindowsAddCertificateToRootStore() => WriteEvent(45); @@ -946,7 +941,6 @@ public class CertificateManagerEventSource : EventSource [Event(56, Level = EventLevel.Error, Message = "An error has occurred while importing the certificate to the keychain: {0}.")] internal void MacOSAddCertificateToKeyChainError(int exitCode) => WriteEvent(56, exitCode); - [Event(57, Level = EventLevel.Verbose, Message = "Writing the certificate to: {0}.")] public void WritePemKeyToDisk(string path) => WriteEvent(57, path); diff --git a/src/Shared/CertificateGeneration/MacOSCertificateManager.cs b/src/Shared/CertificateGeneration/MacOSCertificateManager.cs index 5bc7a026cd47..4ad94e7942a2 100644 --- a/src/Shared/CertificateGeneration/MacOSCertificateManager.cs +++ b/src/Shared/CertificateGeneration/MacOSCertificateManager.cs @@ -129,7 +129,6 @@ internal override CheckCertificateStateResult CheckCertificateState(X509Certific } } - internal override void CorrectCertificateState(X509Certificate2 candidate) { var status = CheckCertificateState(candidate, true); @@ -139,7 +138,6 @@ internal override void CorrectCertificateState(X509Certificate2 candidate) } } - public override bool IsTrusted(X509Certificate2 certificate) { var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); diff --git a/src/Shared/CommandLineUtils/CommandLine/CommandOptionType.cs b/src/Shared/CommandLineUtils/CommandLine/CommandOptionType.cs index 2c4774247547..a7512d226851 100644 --- a/src/Shared/CommandLineUtils/CommandLine/CommandOptionType.cs +++ b/src/Shared/CommandLineUtils/CommandLine/CommandOptionType.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - namespace Microsoft.Extensions.CommandLineUtils; internal enum CommandOptionType diff --git a/src/Shared/Diagnostics/BaseView.cs b/src/Shared/Diagnostics/BaseView.cs index 9c14c9cd3ba0..1987c9ff161e 100644 --- a/src/Shared/Diagnostics/BaseView.cs +++ b/src/Shared/Diagnostics/BaseView.cs @@ -160,7 +160,6 @@ protected void WriteAttributeTo( throw new ArgumentNullException(nameof(trailer)); } - WriteLiteralTo(writer, leader); foreach (var value in values) { diff --git a/src/Shared/E2ETesting/BrowserFixture.cs b/src/Shared/E2ETesting/BrowserFixture.cs index 7972bdf6e8f0..7416e2dad044 100644 --- a/src/Shared/E2ETesting/BrowserFixture.cs +++ b/src/Shared/E2ETesting/BrowserFixture.cs @@ -132,7 +132,6 @@ private async Task DeleteBrowserUserProfileDirectoriesAsync() createBrowserFunc = CreateBrowserAsync; } - return _browsers.GetOrAdd(isolationContext, createBrowserFunc, output); } diff --git a/src/Shared/RazorViews/BaseView.cs b/src/Shared/RazorViews/BaseView.cs index 6ea2345f35f1..7f110b48eb74 100644 --- a/src/Shared/RazorViews/BaseView.cs +++ b/src/Shared/RazorViews/BaseView.cs @@ -60,7 +60,6 @@ internal abstract class BaseView /// protected JavaScriptEncoder JavaScriptEncoder { get; set; } = JavaScriptEncoder.Default; - /// /// Execute an individual request /// diff --git a/src/Shared/ResultsTests/VirtualFileResultTestBase.cs b/src/Shared/ResultsTests/VirtualFileResultTestBase.cs index 271fd33bcbc3..8f1fb2a53d60 100644 --- a/src/Shared/ResultsTests/VirtualFileResultTestBase.cs +++ b/src/Shared/ResultsTests/VirtualFileResultTestBase.cs @@ -51,7 +51,6 @@ public async Task WriteFileAsync_WritesRangeRequested( var httpContext = GetHttpContext(GetFileProvider(path)); httpContext.Features.Set(sendFileFeature); - var requestHeaders = httpContext.Request.GetTypedHeaders(); requestHeaders.Range = new RangeHeaderValue(start, end); requestHeaders.IfUnmodifiedSince = DateTimeOffset.MinValue.AddDays(1); @@ -296,7 +295,6 @@ public async Task WriteFileAsync_RangeRequested_NotModified() var httpContext = GetHttpContext(GetFileProvider(path)); httpContext.Features.Set(sendFileFeature); - var requestHeaders = httpContext.Request.GetTypedHeaders(); requestHeaders.IfModifiedSince = DateTimeOffset.MinValue.AddDays(1); httpContext.Request.Headers.Range = "bytes = 0-6"; diff --git a/src/Shared/ServerInfrastructure/Http2/Http2ErrorCode.cs b/src/Shared/ServerInfrastructure/Http2/Http2ErrorCode.cs index 2a99d53db435..c4cf3852ade6 100644 --- a/src/Shared/ServerInfrastructure/Http2/Http2ErrorCode.cs +++ b/src/Shared/ServerInfrastructure/Http2/Http2ErrorCode.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; internal enum Http2ErrorCode : uint diff --git a/src/Shared/StackTrace/StackFrame/StackTraceHelper.cs b/src/Shared/StackTrace/StackFrame/StackTraceHelper.cs index bda9793265d9..93b3b667d0a1 100644 --- a/src/Shared/StackTrace/StackFrame/StackTraceHelper.cs +++ b/src/Shared/StackTrace/StackFrame/StackTraceHelper.cs @@ -151,7 +151,6 @@ private static bool ShowInStackTrace(MethodBase? method) return false; } - var type = method.DeclaringType; if (type == null) { diff --git a/src/Shared/test/Shared.Tests/AdaptiveCapacityDictionaryTests.cs b/src/Shared/test/Shared.Tests/AdaptiveCapacityDictionaryTests.cs index ad7005ef6600..fb630e8bfda0 100644 --- a/src/Shared/test/Shared.Tests/AdaptiveCapacityDictionaryTests.cs +++ b/src/Shared/test/Shared.Tests/AdaptiveCapacityDictionaryTests.cs @@ -825,7 +825,6 @@ public void Remove_ListStorage_True_CaseInsensitive() Assert.IsType[]>(dict._arrayStorage); } - [Fact] public void Remove_KeyAndOutValue_EmptyStorage() { diff --git a/src/Shared/test/Shared.Tests/CopyOnWriteDictionaryTest.cs b/src/Shared/test/Shared.Tests/CopyOnWriteDictionaryTest.cs index 0db0b176dac3..405a5fee1061 100644 --- a/src/Shared/test/Shared.Tests/CopyOnWriteDictionaryTest.cs +++ b/src/Shared/test/Shared.Tests/CopyOnWriteDictionaryTest.cs @@ -97,7 +97,6 @@ public void ReadOperation_DoesNotDelegateToSourceDictionary_OnceDictionaryIsModi copyOnWriteDictionary.Add("key3", "value3"); copyOnWriteDictionary.Remove("key1"); - // Assert Assert.Equal(2, sourceDictionary.Count); Assert.Equal("value1", sourceDictionary["key1"]); diff --git a/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubClientProxyGenerator.Emitter.cs b/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubClientProxyGenerator.Emitter.cs index c46c13525a8d..3822dab43b64 100644 --- a/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubClientProxyGenerator.Emitter.cs +++ b/src/SignalR/clients/csharp/Client.SourceGenerator/src/HubClientProxyGenerator.Emitter.cs @@ -186,7 +186,6 @@ namespace {_spec.SetterNamespace} lambaParams.Append("()"); } - var lambda = $"{lambaParams} => provider.{member.Name}{lambaParams}"; var call = $"connection.On{genericArgs}(\"{member.Name}\", {lambda})"; diff --git a/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs b/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs index 55e26e24c24c..59bb41e5d3f6 100644 --- a/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs +++ b/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs @@ -1939,7 +1939,6 @@ bool ExpectedErrors(WriteContext writeContext) return Task.CompletedTask; }; - await connection.StartAsync().DefaultTimeout(); var initialConnectionId = connection.ConnectionId; diff --git a/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs b/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs index 7bd749f8ad24..e39a5f35f3be 100644 --- a/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs +++ b/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs @@ -108,7 +108,6 @@ public async Task HttpConnectionSetsUserAgentOnAllRequests(HttpTransportType tra var testHttpHandler = new TestHttpMessageHandler(autoNegotiate: false); var requestsExecuted = false; - testHttpHandler.OnNegotiate((_, cancellationToken) => { return ResponseUtils.CreateResponse(HttpStatusCode.OK, ResponseUtils.CreateNegotiationContent()); diff --git a/src/SignalR/clients/csharp/Client/test/UnitTests/HubConnectionTests.ConnectionLifecycle.cs b/src/SignalR/clients/csharp/Client/test/UnitTests/HubConnectionTests.ConnectionLifecycle.cs index 27dac4d42cde..93ceca27dea5 100644 --- a/src/SignalR/clients/csharp/Client/test/UnitTests/HubConnectionTests.ConnectionLifecycle.cs +++ b/src/SignalR/clients/csharp/Client/test/UnitTests/HubConnectionTests.ConnectionLifecycle.cs @@ -34,7 +34,6 @@ public class ConnectionLifecycle : VerifiableLoggedTest public static IEnumerable MethodsNamesThatRequireActiveConnection => MethodsThatRequireActiveConnection.Keys.Select(k => new object[] { k }); - [Fact] public async Task StartAsyncStartsTheUnderlyingConnection() { diff --git a/src/SignalR/common/Http.Connections/src/ConnectionEndpointRouteBuilderExtensions.cs b/src/SignalR/common/Http.Connections/src/ConnectionEndpointRouteBuilderExtensions.cs index 459ee47692b8..5e533cfce1af 100644 --- a/src/SignalR/common/Http.Connections/src/ConnectionEndpointRouteBuilderExtensions.cs +++ b/src/SignalR/common/Http.Connections/src/ConnectionEndpointRouteBuilderExtensions.cs @@ -70,7 +70,6 @@ public static ConnectionEndpointRouteBuilder MapConnectionHandler /// Maps incoming requests with the specified path to the provided connection pipeline. /// diff --git a/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs b/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs index 7095f1d55d71..cbc8432edf6a 100644 --- a/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs +++ b/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs @@ -1511,7 +1511,6 @@ public async Task RequestToDisposedConnectionIdReturns404(HttpTransportType tran var options = new HttpConnectionDispatcherOptions(); await dispatcher.ExecuteAsync(context, options, app); - Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); if (transportType == HttpTransportType.LongPolling) diff --git a/src/SignalR/common/Protocols.MessagePack/src/Protocol/MessagePackHubProtocol.cs b/src/SignalR/common/Protocols.MessagePack/src/Protocol/MessagePackHubProtocol.cs index 8723ea08aca0..dda7dd09f287 100644 --- a/src/SignalR/common/Protocols.MessagePack/src/Protocol/MessagePackHubProtocol.cs +++ b/src/SignalR/common/Protocols.MessagePack/src/Protocol/MessagePackHubProtocol.cs @@ -66,7 +66,6 @@ public bool TryParseMessage(ref ReadOnlySequence input, IInvocationBinder public void WriteMessage(HubMessage message, IBufferWriter output) => _worker.WriteMessage(message, output); - /// public ReadOnlyMemory GetMessageBytes(HubMessage message) => _worker.GetMessageBytes(message); diff --git a/src/SignalR/common/Protocols.NewtonsoftJson/src/Protocol/NewtonsoftJsonHubProtocol.cs b/src/SignalR/common/Protocols.NewtonsoftJson/src/Protocol/NewtonsoftJsonHubProtocol.cs index c96a4099faa1..d9d1ba4d7895 100644 --- a/src/SignalR/common/Protocols.NewtonsoftJson/src/Protocol/NewtonsoftJsonHubProtocol.cs +++ b/src/SignalR/common/Protocols.NewtonsoftJson/src/Protocol/NewtonsoftJsonHubProtocol.cs @@ -222,7 +222,6 @@ public ReadOnlyMemory GetMessageBytes(HubMessage message) hasItem = true; - string? id = null; if (!string.IsNullOrEmpty(invocationId)) { diff --git a/src/SignalR/common/SignalR.Common/test/Internal/Formatters/BinaryMessageFormatterTests.cs b/src/SignalR/common/SignalR.Common/test/Internal/Formatters/BinaryMessageFormatterTests.cs index 6dad1ccf7c70..b0cca520f718 100644 --- a/src/SignalR/common/SignalR.Common/test/Internal/Formatters/BinaryMessageFormatterTests.cs +++ b/src/SignalR/common/SignalR.Common/test/Internal/Formatters/BinaryMessageFormatterTests.cs @@ -148,7 +148,6 @@ public static IEnumerable RandomPayloads() yield return new[] { CreatePayload(0xc0de) }; } - private static byte[] CreatePayload(int size) => Enumerable.Range(0, size).Select(n => (byte)(n & 0xff)).ToArray(); } diff --git a/src/SignalR/common/SignalR.Common/test/Internal/Protocol/MemoryBufferWriterTests.cs b/src/SignalR/common/SignalR.Common/test/Internal/Protocol/MemoryBufferWriterTests.cs index b63ca76e2405..8b8756efbc29 100644 --- a/src/SignalR/common/SignalR.Common/test/Internal/Protocol/MemoryBufferWriterTests.cs +++ b/src/SignalR/common/SignalR.Common/test/Internal/Protocol/MemoryBufferWriterTests.cs @@ -282,7 +282,6 @@ public void CopyToWithExactlyFullSegmentsWorks() } } - [Fact] public void CopyToWithExactlyFullSegmentsWorks_CopyTo() { @@ -330,7 +329,6 @@ public void CopyToWithSomeFullSegmentsWorks() } } - [Fact] public void CopyToWithSomeFullSegmentsWorks_CopyTo() { diff --git a/src/SignalR/server/SignalR/test/DefaultHubActivatorTests.cs b/src/SignalR/server/SignalR/test/DefaultHubActivatorTests.cs index a86e24a658c8..9f6617445d56 100644 --- a/src/SignalR/server/SignalR/test/DefaultHubActivatorTests.cs +++ b/src/SignalR/server/SignalR/test/DefaultHubActivatorTests.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -35,7 +35,6 @@ public void HubCanBeResolvedFromServiceProvider() new DefaultHubActivator(mockServiceProvider.Object).Create()); } - [Fact] public void DisposeNotCalledForHubsResolvedFromServiceProvider() { diff --git a/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs b/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs index 8a9c43830065..5ba25ff7bfab 100644 --- a/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs +++ b/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs @@ -4289,7 +4289,6 @@ public async Task StreamHubMethodCanAcceptNullableParameter() } } - [Fact] public async Task StreamHubMethodCanAcceptNullableParameterWithCancellationToken() { diff --git a/src/SignalR/server/SignalR/test/HubFilterTests.cs b/src/SignalR/server/SignalR/test/HubFilterTests.cs index 962cc4acebbc..d8c996dc8f89 100644 --- a/src/SignalR/server/SignalR/test/HubFilterTests.cs +++ b/src/SignalR/server/SignalR/test/HubFilterTests.cs @@ -150,7 +150,6 @@ public async Task HubFilterDoesNotNeedToImplementMethods() }); }, LoggerFactory); - var connectionHandler = serviceProvider.GetService>(); using (var client = new TestClient()) diff --git a/src/SignalR/server/SignalR/test/SerializedHubMessageTests.cs b/src/SignalR/server/SignalR/test/SerializedHubMessageTests.cs index a37ff85d29a2..f20bc24561e5 100644 --- a/src/SignalR/server/SignalR/test/SerializedHubMessageTests.cs +++ b/src/SignalR/server/SignalR/test/SerializedHubMessageTests.cs @@ -39,7 +39,6 @@ public void GetSerializedMessageReturnsCachedSerializationIfAvailable() // Get it again var serialized = message.GetSerializedMessage(protocol); - Assert.Equal(DummyHubProtocol.DummySerialization, serialized.ToArray()); // We should still only have written one message diff --git a/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs b/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs index d94b7a77949f..f5970d8a1197 100644 --- a/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs +++ b/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs @@ -152,7 +152,6 @@ public void EnsureCreateHttpsCertificate_DoesNotCreateACertificate_WhenThereIsAn Assert.NotNull(exportedCertificate); Assert.True(exportedCertificate.HasPrivateKey); - Assert.Equal(httpsCertificate.GetCertHashString(), exportedCertificate.GetCertHashString()); } diff --git a/src/Tools/dotnet-user-secrets/src/Internal/RemoveCommand.cs b/src/Tools/dotnet-user-secrets/src/Internal/RemoveCommand.cs index cbaa5a94d565..f2ddb23ceeb0 100644 --- a/src/Tools/dotnet-user-secrets/src/Internal/RemoveCommand.cs +++ b/src/Tools/dotnet-user-secrets/src/Internal/RemoveCommand.cs @@ -26,7 +26,6 @@ public static void Configure(CommandLineApplication command, CommandLineOptions }); } - public RemoveCommand(string keyName) { _keyName = keyName;