Skip to content

Commit

Permalink
Solve 404 error in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ngruson committed Dec 8, 2023
1 parent 7419d85 commit d3a5b8f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@ public async Task DiagnosticSourceExceptionCallBackIsNotReceivedForExceptionsHan
int numberOfUnSubscribedEvents = 0;
int numberOfSubscribedEvents = 0;
int numberOfExceptionCallbacks = 0;
bool exceptionHandled = false;

// configure SDK
this.tracerProvider = Sdk.CreateTracerProviderBuilder()
Expand Down Expand Up @@ -1004,18 +1005,18 @@ public async Task DiagnosticSourceExceptionCallBackIsNotReceivedForExceptionsHan
})
.Build();

TestMiddleware.Create(builder => builder
.UseExceptionHandler(handler =>
handler.Run(async (ctx) =>
{
exceptionHandled = true;
await ctx.Response.WriteAsync("handled");
})));

using (var client = this.factory
.WithWebHostBuilder(builder =>
{
builder.ConfigureLogging(loggingBuilder => loggingBuilder.ClearProviders());
builder.Configure(app => app
.UseExceptionHandler(handler =>
{
handler.Run(async (ctx) =>
{
await ctx.Response.WriteAsync("handled");
});
}));
})
.CreateClient())
{
Expand All @@ -1033,6 +1034,7 @@ public async Task DiagnosticSourceExceptionCallBackIsNotReceivedForExceptionsHan
Assert.Equal(0, numberOfExceptionCallbacks);
Assert.Equal(0, numberOfUnSubscribedEvents);
Assert.Equal(2, numberOfSubscribedEvents);
Assert.True(exceptionHandled);
}

public void Dispose()
Expand Down
2 changes: 2 additions & 0 deletions test/TestApp.AspNetCore/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public static void Main(string[] args)

app.UseMiddleware<ActivityMiddleware>();

app.AddTestMiddleware();

app.Run();
}
}
37 changes: 37 additions & 0 deletions test/TestApp.AspNetCore/TestMiddleware.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// <copyright file="TestMiddleware.cs" company="OpenTelemetry Authors">

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (ubuntu-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net6.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net8.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-report (windows-latest)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-report (windows-latest)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-report (windows-latest)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-report (windows-latest)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-report (windows-latest)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-report (windows-latest)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net462)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-experimental (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check warning on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / check-format-stable

The file header copyright text should match the copyright text from the settings.

Check warning on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / check-format-stable

The file header copyright text should match the copyright text from the settings.

Check warning on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / check-format-stable

The file header copyright text should match the copyright text from the settings.

Check warning on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / check-format-experimental

The file header copyright text should match the copyright text from the settings.

Check warning on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / check-format-experimental

The file header copyright text should match the copyright text from the settings.

Check warning on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / check-format-experimental

The file header copyright text should match the copyright text from the settings.

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)

Check failure on line 1 in test/TestApp.AspNetCore/TestMiddleware.cs

View workflow job for this annotation

GitHub Actions / build-test-stable (windows-latest, net7.0)

The file header copyright text should match the copyright text from the settings. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1636.md)
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>

namespace TestApp.AspNetCore;

public static class TestMiddleware
{
private static readonly AsyncLocal<Action<IApplicationBuilder>?> Current = new();

public static IApplicationBuilder AddTestMiddleware(this IApplicationBuilder builder)
{
if (Current.Value is { } configure)
{
configure(builder);
}

return builder;
}

public static void Create(Action<IApplicationBuilder> action)
{
Current.Value = action;
}
}

0 comments on commit d3a5b8f

Please sign in to comment.