From kagents
.NET Aspire integration testing — DistributedApplicationTestingBuilder, AppHost test fixtures, service mocking, health check validation, TUnit with ClassDataSource. USE FOR: writing and debugging integration tests against Aspire-orchestrated services. DO NOT USE FOR: Aspire app configuration (use aspire-architecture) or unit tests without Aspire (use tunit-patterns).
npx claudepluginhub grexyloco/k.agentsThis skill uses the workspace's default tool permissions.
Adaptiert von: [Aaronontheweb/dotnet-skills](https://github.com/Aaronontheweb/dotnet-skills) (MIT)
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Adaptiert von: Aaronontheweb/dotnet-skills (MIT) Angepasst für TUnit (nicht xUnit wie im Original).
<PackageReference Include="Aspire.Hosting.Testing" Version="*" />
<PackageReference Include="TUnit" Version="*" />
public class AspireAppFixture : IAsyncDisposable
{
public DistributedApplication App { get; private set; } = null!;
public HttpClient ApiClient { get; private set; } = null!;
public AspireAppFixture()
{
var builder = await DistributedApplicationTestingBuilder
.CreateAsync<Projects.MyApp_AppHost>();
// Optional: Services mocken oder konfigurieren
builder.Services.ConfigureHttpClientDefaults(http =>
http.AddStandardResilienceHandler());
App = await builder.BuildAsync();
await App.StartAsync();
ApiClient = App.CreateHttpClient("api");
}
public async ValueTask DisposeAsync()
{
await App.DisposeAsync();
ApiClient.Dispose();
}
}
[Test]
[ClassDataSource<AspireAppFixture>(Shared = SharedType.PerTestSession)]
public async Task Api_HealthCheck_ReturnsHealthy(AspireAppFixture app)
{
var response = await app.ApiClient.GetAsync("/health");
await Assert.That((int)response.StatusCode).IsEqualTo(200);
}
[Test]
[ClassDataSource<AspireAppFixture>(Shared = SharedType.PerTestSession)]
public async Task Api_GetUsers_ReturnsData(AspireAppFixture app)
{
var response = await app.ApiClient.GetAsync("/api/users");
response.EnsureSuccessStatusCode();
var users = await response.Content.ReadFromJsonAsync<List<UserResponse>>();
await Assert.That(users).IsNotNull();
}
// Dashboard-URL für Debugging
var dashboardUrl = App.GetEndpoint("aspire-dashboard");
// Logs und Traces live beobachten während Tests laufen
PerTestSession Shared Scope um AppHost nur einmal zu startenCreateHttpClient("service-name") nutzt Service Discovery