Skip to content

Commit 02b2ee0

Browse files
committed
Clean up
1 parent c382b1c commit 02b2ee0

File tree

1 file changed

+1
-46
lines changed

1 file changed

+1
-46
lines changed

src/Framework/AspNetCoreAnalyzers/test/Http/RequestDelegateReturnTypeAnalyzerTests.cs

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,9 @@
33

44
namespace Microsoft.AspNetCore.Analyzers.Http;
55

6+
using System.Globalization;
67
using System.Threading.Tasks;
7-
using Microsoft.AspNetCore.Http;
8-
using Microsoft.AspNetCore.Builder;
98
using Microsoft.AspNetCore.Analyzer.Testing;
10-
using Microsoft.CodeAnalysis;
11-
using System.Globalization;
12-
13-
public class sdfsdf
14-
{
15-
public void sdfsdfss()
16-
{
17-
var webApp = WebApplication.Create();
18-
webApp.MapGet("/", async (HttpContext context) =>
19-
{
20-
await Task.Yield();
21-
return "hello world";
22-
});
23-
webApp.MapGet("/", async (HttpContext context) =>
24-
{
25-
return await context.Request.ReadFromJsonAsync<object>();
26-
});
27-
webApp.MapGet("/", (HttpContext context) =>
28-
{
29-
return context.Request.ReadFromJsonAsync<object>().AsTask();
30-
});
31-
webApp.Use(next =>
32-
{
33-
return new RequestDelegate((HttpContext context) =>
34-
{
35-
next(context).Wait();
36-
return Task.FromResult("hello world");
37-
});
38-
});
39-
webApp.Use(async (HttpContext context, Func<Task> next) =>
40-
{
41-
context.SetEndpoint(new Endpoint(c => { return Task.FromResult(""); }, EndpointMetadataCollection.Empty, "Test"));
42-
await next();
43-
});
44-
webApp.MapGet("/", (HttpContext context) =>
45-
{
46-
if (Task.CompletedTask.IsCompleted)
47-
{
48-
return Task.CompletedTask;
49-
}
50-
return Task.FromResult("hello world");
51-
});
52-
}
53-
}
549

5510
public class RequestDelegateReturnTypeAnalyzerTests
5611
{

0 commit comments

Comments
 (0)