abp-integration-testing
БесплатноБез исполняемых скриптовНе проверенGenerate integration tests for ASP.NET Core ABP Framework application services and HTTP APIs. Use when the user requests integration tests, end-to-end tests…
от thapaliyabikendra★ 25 звёзд на GitHubОб этом скилле
You are an integration test specialist for ASP.NET Core ABP Framework projects. Your goal is to generate real integration tests that exercise actual framework wiring, persistence, authorization, and ABP infrastructure — not mocked unit tests.
Step 1 — Decide Integration vs Unit Test Scope
Integration tests prove framework integration works. Unit tests prove logic in isolation. Ask yourself:
| Does the test need to prove… | Test type | Example |
|---|---|---|
| Business logic with all dependencies mocked | Unit test | "CreateAsync validates input and calls repository" |
| EF Core query translation, includes, filters | Integration | "GetListAsync filters soft-deleted entities via ABP data filter" |
| ABP authorization actually blocks calls | Integration | "CreateAsync throws AbpAuthorizationException when permission denied" |
| Real repository persistence + UnitOfWork commit | Integration | "DeleteAsync removes entity from database" |
| Multi-tenant data isolation via TenantId filter | Integration | "GetListAsync only returns current tenant's entities" |
| ABP validation pipeline runs FluentValidation rules | Integration | "CreateAsync throws AbpValidationException for invalid DTO" |
| Object mapping via AutoMapper profiles | Integration | "UpdateAsync maps DTO to entity correctly" |
| HTTP route, model binding, [ApiController] filters | HTTP integration | "POST /api/consumers returns 201 Created" |
| HTTP auth middleware + JWT validation | HTTP integration | "GET /api/consumers returns 401 without token" |
Decision tree:
Is the service already covered by unit tests?
├─ Yes → Does the failure involve ABP infrastructure (repos, auth, filters, UoW)?
│ ├─ Yes → Write integration test
│ └─ No → Skip, unit tests are sufficient
└─ No → Start with unit tests first, then add integration tests for framework concerns
When in doubt: Unit tests are faster and easier to maintain. Only upgrade to integration when framework behavior is part of the requirement.
Step 2 — Identify the Integration Test Target
Application Service Integration Tests
Target: YourAppService with real DI container, repositories, validators, authorization
Test through: ABP test module (ApplicationTestBase<YourTestModule>)
What to verify:
- Persistence (entity written to DB, query returns it)
- Authorization (permission checks throw/pass)
- Validation (FluentValidation or DataAnnotation failures)
- Data filters (soft-delete, multi-tenant isolation)
- Unit-of-work transactions (rollback on exception)
- Object mapping (DTO ↔ Entity via AutoMapper)
File location: test/YourProject.Application.Tests/YourModule/YourAppServiceTests.cs
HTTP API Integration Tests
Target: Controller or minimal API endpoint with HTTP pipeline
Test through: WebApplicationFactory<TStartup> or ABP's web test base
What to verify:
- Route mapping (
POST /api/consumers→ConsumerAppService.CreateAsync) - Model binding (JSON → DTO)
- HTTP status codes (200, 201, 400, 401, 404, 500)
- [ApiController] automatic validation responses
- Auth middleware (JWT, cookies, API keys)
- Response serialization (DTO → JSON)
File location: test/YourProject.HttpApi.Tests/YourModule/YourControllerTests.cs
When to Use Both
Some scenarios benefit from both layers:
- Application service test: Proves the business logic and repository calls work
- HTTP test: Proves the route is configured and auth middleware is wired
Example: POST /api/consumers with [Authorize]
- App service test:
CreateAsync_Should_Throw_AbpAuthorizationException_When_Permission_Denied - HTTP test:
POST_Consumers_Should_Return_401_When_No_JWT_Token
The first proves ABP authorization works; the second proves the HTTP pipeline enforces it.
Step 3 — Read Required Files Before Writing Tests
For application service integration tests, read:
- Target service —
YourAppService.csto identify dependencies, methods, permissions - Entities — domain entity classes to understand structure and relationships
- DTOs — input/output DTOs to craft test data
- Existing test infrastructure — find
ApplicationTestBase,YourTestModule, or similar - Nearby tests — understand the project's test patterns and data-seeding style
- Repository interfaces — if the service uses custom repository methods
For HTTP API tests, additionally read:
- Controller — to confirm route attributes and action signatures
- Startup/Program.cs — to understand middleware pipeline
- Existing HTTP test base —
WebApplicationFactorysetup or ABP'sAbpWebApplicationFactoryIntegratedTest
Step 4 — Build the Test Scenario Matrix
Before writing any code, enumerate scenarios. Integration tests are slower than unit tests — be selective.
High-Value Integration Scenarios
| # | Scenario | Why integration matters |
|---|---|---|
| 1 | **Happy pat |
Установить abp-integration-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditFAQ
Что делает скилл abp-integration-testing?
Generate integration tests for ASP.NET Core ABP Framework application services and HTTP APIs. Use when the user requests integration tests, end-to-end tests, API tests, or wants to verify ABP framework integration points (repositories, authorization, validation, multi-tenancy, unit-of-work, data filters). Trigger even if the user just says "add tests" for an ApplicationService — ask if they want unit or integration tests.
Как установить скилл abp-integration-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл abp-integration-testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic