test(benchmarks): add C#/ASP.NET and TypeScript tasks

Six tasks with hidden checks: ASP.NET validation and 404 handling, C#
cancellation, and TypeScript overlap, deep merge, and debounce fixes, checked
with dotnet run and node --test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian lechnerandClaude Opus 5.5 committed 2026-10-01 13:59:12 +02:00
1 parent 97879fd6a5
commit f43a2df14b
30 files changed
+349 -2

No files matched your search

@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<ProjectReference Include="..\..\src\Shop\Shop.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,24 @@
using System.Net;
using System.Text;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Hosting.Server.Features;
using Microsoft.Extensions.DependencyInjection;
var app = Shop.AppHost.Build(new[] { "--urls", "http://127.0.0.1:0" });
await app.StartAsync();
var address = app.Services.GetRequiredService<IServer>().Features.Get<IServerAddressesFeature>()!.Addresses.First();
using var client = new HttpClient { BaseAddress = new Uri(address) };
var failures = new List<string>();
async Task Expect(string json, int status)
{
var response = await client.PostAsync("/orders", new StringContent(json, Encoding.UTF8, "application/json"));
if ((int)response.StatusCode != status) failures.Add($"{json} -> {(int)response.StatusCode}, expected {status}");
else if (status == 400 && response.Content.Headers.ContentType?.MediaType != "application/problem+json") failures.Add($"{json} -> 400 without problem details");
}
await Expect("{\"sku\":\"A1\",\"quantity\":2}", 201);
await Expect("{\"sku\":\"A1\",\"quantity\":0}", 400);
await Expect("{\"sku\":\"A1\",\"quantity\":-3}", 400);
await Expect("{\"sku\":\"\",\"quantity\":1}", 400);
await app.StopAsync();
foreach (var failure in failures) Console.Error.WriteLine("FAIL " + failure);
return failures.Count == 0 ? 0 : 1;
@@ -0,0 +1,20 @@
namespace Shop;
public static class AppHost
{
// Integration tests start the application through Build.
public static WebApplication Build(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
var orders = new List<Order>();
app.MapPost("/orders", (Order order) =>
{
orders.Add(order);
return Results.Created($"/orders/{orders.Count}", order);
});
return app;
}
}
public record Order(string Sku, int Quantity);
@@ -0,0 +1 @@
Shop.AppHost.Build(args).Run();
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
@@ -0,0 +1,13 @@
{
"prompt": "POST /orders accepts orders with a zero or negative quantity and orders with an empty SKU. Reject those with HTTP 400 and a validation problem response; valid orders must still return 201.",
"check": [
"dotnet",
"run",
"--project",
"bench_hidden/Check",
"--nologo"
],
"workflow": {
"kind": "C#/ASP.NET change"
}
}