Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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:

  1. Target service — YourAppService.cs to identify dependencies, methods, permissions
  2. Entities — domain entity classes to understand structure and relationships
  3. DTOs — input/output DTOs to craft test data
  4. Existing test infrastructure — find ApplicationTestBase, YourTestModule, or similar
  5. Nearby tests — understand the project's test patterns and data-seeding style
  6. Repository interfaces — if the service uses custom repository methods

For HTTP API tests, additionally read:

  1. Controller — to confirm route attributes and action signatures
  2. Startup/Program.cs — to understand middleware pipeline
  3. Existing HTTP test base — WebApplicationFactory setup or ABP's AbpWebApplicationFactoryIntegratedTest

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
Полный SKILL.md на GitHub

Установить abp-integration-testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Grep
Glob
Write
Edit

FAQ

Что делает скилл 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), без исполняемых скриптов.

Похожие скиллы

Сравнить abp-integration-testing с