Test unit

From duranserkan/DRN-Project · View interactive version

Test unit is an AI agent skill from the GitHub repository duranserkan/DRN-Project. Use when adding or reviewing fast isolated tests for pure logic, deterministic branches, service wiring, validation, or regression coverage without external infrastructure.

How to use this skill

Skill file

Unit Testing

Load the repository profile first. Apply its testing skill for custom attributes and contexts before this generic guide.

Attribute Choice

Unit Scope

Good unit targets:

Prefer integration tests when persistence, SQL, interceptors, middleware, auth, serialization boundaries, or real transport behavior matter.

Consolidation

Parameterize identical bodies with multiple rows. Extend an existing test class when it already owns the component. Keep separate tests when setup, behavior, or assertion shape differs enough that a combined flow becomes harder to read.

Composed Decisions

Use modified condition/decision coverage (MC/DC) when each condition must independently affect a decision. Pair fixtures that change only the target condition and flip the result. For a simple AND, hold the other conditions true. For a simple OR, hold them false. For mixed expressions, verify each pair against the full expression. Keep a positive full-expression fixture and assert exact outputs or membership. Add broader combinations only for distinct interactions. Apply this to authorization, validation, feature gates, and query filters.

Service Validation

Use the repository's DI container and validation helpers when available. Prove the graph composes and scoped/singleton rules hold. Keep behavior tests separate.

Verification

Follow the diagnostic suppression guidance.

Run unit tests only when user and repository instructions allow execution. Use the profile command or discover the narrowest unit-test project or package script.

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.