Test integration api

From duranserkan/DRN-Project · View interactive version

Test integration api is an AI agent skill from the GitHub repository duranserkan/DRN-Project. Use when testing web/API request pipelines, endpoints, routing, auth, middleware, serialization, typed HTTP clients, or outbound HTTP behavior.

How to use this skill

Skill file

API Integration Testing

Exercise the request pipeline through the repository's approved test host. Apply profile conventions for authentication, fixtures, and execution.

Core Patterns

Test Client

Use the local framework's test-host abstraction, such as WebApplicationFactory<TProgram> in ASP.NET Core, to exercise the real request pipeline.

Assert the endpoint's exact status, response shape, and relevant headers. A successful status alone does not prove the contract.

When the repository has an authenticated-client helper, prefer it over manually crafting cookies, claims, or tokens in each test.

Mocking HTTP Dependencies

Mock downstream services at the transport boundary to test proxy behavior and failure modes. Keep the application pipeline real and replace only the external dependency.

Configure transport failures through the repository fixture. Assert the application's documented failure response, rather than assuming every downstream error becomes HTTP 502.

Route Validation

Validate route metadata without starting the full app server only when route data is the behavior under test. Otherwise, prefer an actual request so middleware, filters, serialization, and auth participate.

API discovery can mix controller and minimal endpoints. Type-check action descriptors before accessing controller-specific metadata. Do not cast the entire discovery collection to controller descriptors.

Test Isolation

Composed Request Decisions

Apply MC/DC fixture rules to authorization, validation, tenant, middleware, and feature-gate decisions. Pair requests and assert exact status and response membership. Cover distinct pipeline interactions.

Related

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.