generating-tests

Generate xUnit tests for C#/.NET ABP Framework projects.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "generating-tests" with this command: npx skills add thapaliyabikendra/ai-artifacts/thapaliyabikendra-ai-artifacts-generating-tests

Generating Tests

Generate xUnit tests for C#/.NET ABP Framework projects.

Quick Start

Analyze source and generate tests

python scripts/generate_tests.py src/MyAppService.cs --type unit

Workflow

Copy this checklist and track progress:

Test Generation Progress:

  • Step 1: Locate source file
  • Step 2: Analyze public methods and dependencies
  • Step 3: Select template based on source type
  • Step 4: Generate test file
  • Step 5: Validate generated tests compile

Step 1: Locate source

Input Action

File path Read directly

Class name find api/src -name "ClassName.cs" -type f

gaps

Run scripts/find_coverage_gaps.py

Step 2: Analyze source

Extract from each public method:

  • Method signature (name, parameters, return type)

  • Constructor dependencies → mock with Substitute.For<T>()

  • [Authorize] attributes → add 401/403 test cases

  • FluentValidation rules → add validation error tests

Step 3: Select template

Source Pattern Reference

*AppService.cs

See reference/appservice-tests.md

*Validator.cs

See reference/validator-tests.md

*Controller.cs

See reference/integration-tests.md

Step 4: Generate and write

Output locations:

  • Unit tests: api/test/[Module].Application.Tests/[Class]Tests.cs

  • Integration tests: api/test/[Module].HttpApi.Tests/[Class]IntegrationTests.cs

Step 5: Validate

dotnet build api/test/[Module].Application.Tests/

If build fails, fix compilation errors and rebuild.

Test Naming

Use pattern: [Method][Scenario][Expected]

Example Meaning

Create_ValidInput_ReturnsDto

Happy path

Create_MissingName_ThrowsValidation

Validation failure

Get_NotFound_ThrowsException

Entity not found

Delete_Unauthorized_Returns403

Permission denied

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

abp-infrastructure-patterns

No summary provided by upstream source.

Repository SourceNeeds Review
General

abp-entity-patterns

No summary provided by upstream source.

Repository SourceNeeds Review
General

abp-api-implementation

No summary provided by upstream source.

Repository SourceNeeds Review