Code Testing Extensions
.NET (Microsoft)OfficialPublished by .NET (Microsoft)
- Skill
- Guidelines
- Software development
- MIT
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Code Testing Extensions is a non-invocable reference library designed to support automated testing workflows. It provides a structured collection of documentation files covering various programming languages, including .NET, Python, TypeScript, Go, Java, and more. Each entry offers essential guidance on build and test commands, framework-specific patterns, mocking strategies, and common error resolution. Additionally, the catalog includes example files that demonstrate complete testing pipeline cycles, from research and planning to test generation and reporting.
What it does
- Provides language-specific testing guidance for multiple programming environments.
- Lists standard build and test commands for various testing frameworks.
- Offers best practices for mocking, project layout, and framework detection.
- Includes concrete examples of full testing pipeline workflows.
- Serves as a centralized reference for agents to ensure consistent testing standards.
When to use it
- When an agent needs to determine the correct testing commands for a specific language.
- When implementing or debugging a testing pipeline for a new project.
- When guidance on framework-specific mocking or test structure is required.
- When looking for representative examples of a complete test generation cycle.
Advantages
- Ensures consistency across different testing environments.
- Reduces ambiguity by providing standardized commands and patterns.
- Provides both high-level guidance and concrete implementation examples.
- Supports a wide range of modern programming languages and frameworks.
Usage examples
- “Read extensions/python.md to understand the preferred testing patterns for a pytest project.”
- The agent retrieves the Python-specific guidance, identifying the correct test runner commands and mocking strategies to apply.
- “Consult extensions/java-examples.md to see how to structure a JUnit 5 test suite.”
- The agent reviews the provided example to replicate the established project structure and testing conventions for the Java codebase.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/dotnet/code-testing-extensions/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip code-testing-extensions.zip -d .agents/skills
Documentation by .NET (Microsoft)
Code Testing Extensions
This reference-only catalog lists bundled guidance for the code-testing pipeline. Read the matching file directly; do not invoke this catalog as a skill. Resource paths are relative to this catalog, not the project workspace.
Available Extension Files
| File | Language | Contents |
|---|---|---|
| extensions/dotnet.md | .NET (C#/F#/VB) | Build commands, test commands, project reference validation, common CS error codes, MSTest template |
| extensions/python.md | Python | Framework-adaptive test commands (pytest, custom runners), project layout detection, mocking guidelines, common errors |
| extensions/typescript.md | TypeScript/JavaScript | Build/test commands (Jest/Vitest/Mocha), framework detection, mocking, TS-specific considerations |
| extensions/powershell.md | PowerShell | Test commands (Pester v5), module import patterns, discovery/run pitfalls, mocking, common errors |
| extensions/cpp.md | C++ | Testing internals with friend declarations |
| extensions/go.md | Go | go test commands, table-driven tests, integration vs unit layout, mocking via interfaces, common errors |
| extensions/java.md | Java | Maven/Gradle commands, JUnit 4/5 and TestNG detection, Mockito, Spring Boot slices, common errors |
| extensions/rust.md | Rust | cargo test commands, unit vs integration vs doc tests, features, async test harnesses, common errors |
| extensions/ruby.md | Ruby | RSpec and Minitest commands, Bundler usage, Rails specifics, mocking patterns, common errors |
| extensions/swift.md | Swift | SPM and Xcode test commands, XCTest vs Swift Testing, @testable import, async/throws tests, common errors |
| extensions/kotlin.md | Kotlin | Gradle commands, JUnit/Kotest detection, MockK, coroutines test, KMP and Android specifics, common errors |
| extensions/dotnet-examples.md | .NET (C#/F#/VB) | Concrete pipeline examples: sample research output, plan, generated tests, fix cycles, final report |
| extensions/python-examples.md | Python | Concrete pipeline examples (pytest): research, plan, generated test file, fix cycles, final report |
| extensions/typescript-examples.md | TypeScript/JavaScript | Concrete pipeline examples (Vitest, applicable to Jest): research, plan, generated test file, fix cycles, final report |
| extensions/go-examples.md | Go | Concrete pipeline examples (standard testing): research, plan, table-driven test file, fix cycles, final report |
| extensions/java-examples.md | Java | Concrete pipeline examples (JUnit 5 + Mockito on Maven): research, plan, generated test file, fix cycles, final report |
Usage
Read the appropriate base extension before writing test code. Load an
<language>-examples.md file only when the repository has no representative
tests and the base extension does not resolve the needed pattern. Do not load
end-to-end examples for a focused request with established local conventions.
Files
- ATTRIBUTION.mdAdded by AutoGineer857 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md3.7 KiB
- extensions/cpp-examples.md9.1 KiB
- extensions/cpp.md20.1 KiB
- extensions/dotnet-examples.md10.7 KiB
- extensions/dotnet.md10.5 KiB
- extensions/go-examples.md12.4 KiB
- extensions/go.md7.8 KiB
- extensions/java-examples.md11.9 KiB
- extensions/java.md9.7 KiB
- extensions/kotlin-examples.md10.3 KiB
- extensions/kotlin.md11.2 KiB
- extensions/powershell-examples.md9.1 KiB
- extensions/powershell.md12.1 KiB
- extensions/python-examples.md12.1 KiB
- extensions/python.md11.7 KiB
- extensions/ruby-examples.md8.9 KiB
- extensions/ruby.md14.7 KiB
- extensions/rust-examples.md10.6 KiB
- extensions/rust.md8.8 KiB
- extensions/swift.md9.4 KiB
- extensions/typescript-examples.md12.7 KiB
- extensions/typescript.md7.9 KiB
extensions/kotlin-examples.md
Kotlin Pipeline Examples
Concrete input→output examples for the test generation pipeline targeting a Kotlin JVM codebase using Gradle + JUnit 5. These show what each pipeline phase produces for a small project.
kotlin.testfollows the same shape for multiplatform projects. Replace JUnit Jupiter parameterization with@Testmethods or the repo's established KMP data pattern, and place tests undersrc/commonTest/kotlinor the matching target source set.
Source Under Test
A simple InvoiceService in a Gradle Kotlin JVM project:
settings.gradle.kts
build.gradle.kts
src/main/kotlin/com/contoso/billing/
Invoice.kt
InvoiceRepository.kt
InvoiceService.kt
src/test/kotlin/com/contoso/billing/ (exists, empty)// src/main/kotlin/com/contoso/billing/InvoiceService.kt
package com.contoso.billing
import java.math.BigDecimal
import java.math.RoundingMode
import java.time.Clock
import java.time.LocalDateTime
class InvoiceService(
private val repository: InvoiceRepository,
private val clock: Clock = Clock.systemUTC(),
) {
fun calculateTotal(invoice: Invoice): BigDecimal {
require(invoice.lineItems.isNotEmpty()) { "Invoice has no line items." }
val subtotal = invoice.lineItems
.map { it.unitPrice.multiply(BigDecimal.valueOf(it.quantity.toLong())) }
.fold(BigDecimal.ZERO, BigDecimal::add)
val tax = subtotal.multiply(invoice.taxRate)
return subtotal.add(tax).setScale(2, RoundingMode.HALF_UP)
}
fun getById(id: Int): Invoice = repository.find(id)
?: throw NoSuchElementException("Invoice $id not found.")
fun markAsPaid(id: Int) {
val invoice = getById(id)
check(invoice.status != InvoiceStatus.PAID) { "Invoice is already paid." }
invoice.status = InvoiceStatus.PAID
invoice.paidAt = LocalDateTime.now(clock)
repository.update(invoice)
}
}Sample Research Output
What code-testing-researcher produces in <TESTAGENT_DIR>/research.md:
# Test Generation Research
## Project Overview
- **Path**: /work/contoso-billing
- **Language**: Kotlin 2.0 JVM
- **Build Tool**: Gradle wrapper present (`./gradlew`)
- **Test Framework**: JUnit 5 + kotlin.test assertions (`useJUnitPlatform()` and `junit-jupiter-params` detected)
- **Mocking**: MockK is not present; repository is an interface and can be faked directly
## Coverage Baseline
- **Initial Line Coverage**: unknown
- **Strategy**: broad
- **Existing Test Count**: 0 tests across 0 files
## Build & Test Commands
- **Compile tests**: `./gradlew compileTestKotlin --console=plain`
- **Single class**: `./gradlew test --tests "com.contoso.billing.InvoiceServiceTest" --console=plain`
- **All tests**: `./gradlew test --console=plain`
## Files to Test
### High Priority
| File | Classes/Methods | Testability | Notes |
|------|-----------------|-------------|-------|
| src/main/kotlin/com/contoso/billing/InvoiceService.kt | calculateTotal, getById, markAsPaid | High | Repository interface is fakeable; Clock is injectable |
## Testing Patterns
- No existing patterns; recommend JUnit 5 `@Test`, `@ParameterizedTest` + `@CsvSource`, backticked test names, `kotlin.test` assertions, and a hand-written fake repository.Sample Plan Output
# Test Implementation Plan
## Overview
Generate JUnit 5 tests for InvoiceService covering calculation, lookup, and
paid-state transition behavior.
## Commands
- **Compile tests**: `./gradlew compileTestKotlin --console=plain`
- **Test**: `./gradlew test --tests "com.contoso.billing.InvoiceServiceTest" --console=plain`
## Phase 1: InvoiceService
### Files to Test
- **Source**: `src/main/kotlin/com/contoso/billing/InvoiceService.kt`
- **Test File**: `src/test/kotlin/com/contoso/billing/InvoiceServiceTest.kt`
**Methods to Test**:
1. `calculateTotal` — parameterized tax, zero tax, rounding, empty-line-items error
2. `getById` — existing invoice and missing invoice
3. `markAsPaid` — success with fixed clock, already-paid, missingSample Generated Test File
// src/test/kotlin/com/contoso/billing/InvoiceServiceTest.kt
package com.contoso.billing
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.CsvSource
import java.math.BigDecimal
import java.time.Clock
import java.time.Instant
import java.time.LocalDateTime
import java.time.ZoneOffset
import kotlin.test.assertEquals
import kotlin.test.assertSame
import kotlin.test.assertTrue
class InvoiceServiceTest {
private class FakeRepository : InvoiceRepository {
val invoices = mutableMapOf<Int, Invoice>()
var updated: Invoice? = null
override fun find(id: Int): Invoice? = invoices[id]
override fun update(invoice: Invoice) {
updated = invoice
invoices[invoice.id] = invoice
}
}
@ParameterizedTest(name = "qty={0}, unitPrice={1}, taxRate={2} -> {3}")
@CsvSource(
"1, 100.00, 0.10, 110.00",
"3, 25.00, 0.00, 75.00",
"2, 9.99, 0.07, 21.38",
)
fun `calculateTotal returns expected total for valid line items`(
quantity: Int,
unitPrice: BigDecimal,
taxRate: BigDecimal,
expected: BigDecimal,
) {
val service = InvoiceService(FakeRepository())
val invoice = invoice(
taxRate = taxRate,
lineItems = mutableListOf(LineItem(quantity = quantity, unitPrice = unitPrice)),
)
val total = service.calculateTotal(invoice)
assertEquals(0, total.compareTo(expected), "expected $expected but got $total")
}
@Test
fun `calculateTotal throws for empty line items`() {
val service = InvoiceService(FakeRepository())
val invoice = invoice(lineItems = mutableListOf())
val exception = assertThrows<IllegalArgumentException> { service.calculateTotal(invoice) }
assertTrue(exception.message!!.contains("no line items", ignoreCase = true))
}
@Test
fun `getById returns existing invoice`() {
val repository = FakeRepository()
val expected = invoice(id = 42)
repository.invoices[42] = expected
val service = InvoiceService(repository)
val result = service.getById(42)
assertSame(expected, result)
}
@Test
fun `getById throws for missing invoice`() {
val service = InvoiceService(FakeRepository())
val exception = assertThrows<NoSuchElementException> { service.getById(999) }
assertTrue(exception.message!!.contains("999"))
}
@Test
fun `markAsPaid updates status date and repository`() {
val repository = FakeRepository()
val invoice = invoice(id = 1)
repository.invoices[1] = invoice
val fixedClock = Clock.fixed(Instant.parse("2025-01-01T12:00:00Z"), ZoneOffset.UTC)
val service = InvoiceService(repository, fixedClock)
service.markAsPaid(1)
assertEquals(InvoiceStatus.PAID, invoice.status)
assertEquals(LocalDateTime.ofInstant(fixedClock.instant(), ZoneOffset.UTC), invoice.paidAt)
assertSame(invoice, repository.updated)
}
@Test
fun `markAsPaid throws and does not update already paid invoice`() {
val repository = FakeRepository()
repository.invoices[1] = invoice(id = 1, status = InvoiceStatus.PAID)
val service = InvoiceService(repository)
val exception = assertThrows<IllegalStateException> { service.markAsPaid(1) }
assertTrue(exception.message!!.contains("already paid", ignoreCase = true))
assertEquals(null, repository.updated)
}
@Test
fun `markAsPaid throws and does not update missing invoice`() {
val repository = FakeRepository()
val service = InvoiceService(repository)
val exception = assertThrows<NoSuchElementException> { service.markAsPaid(999) }
assertEquals("Invoice 999 not found.", exception.message)
assertEquals(null, repository.updated)
}
private fun invoice(
id: Int = 1,
status: InvoiceStatus = InvoiceStatus.PENDING,
taxRate: BigDecimal = BigDecimal("0.10"),
lineItems: MutableList<LineItem> = mutableListOf(LineItem(quantity = 1, unitPrice = BigDecimal("100.00"))),
): Invoice = Invoice(id = id, status = status, taxRate = taxRate, lineItems = lineItems, paidAt = null)
}Sample Fix Cycle
When the implementer hits a Gradle or Kotlin compile issue, the fixer agent diagnoses and resolves it.
Build output:
No tests found for given includes: [com.contoso.billing.InvoiceServiceTest]Fixer diagnosis: The test file was created under src/test/java with Kotlin source, so the Kotlin JVM source set did not compile it into the expected package.
Fix applied: Move the file to src/test/kotlin/com/contoso/billing/InvoiceServiceTest.kt and keep package com.contoso.billing at the top.
Rebuild + rerun: ./gradlew test --tests "com.contoso.billing.InvoiceServiceTest" --console=plain → SUCCESS
Another common cycle — JUnit Platform not enabled:
Test output:
0 tests completedFixer diagnosis: The project has JUnit Jupiter dependencies but the Gradle test task is not configured with useJUnitPlatform().
Fix applied: Match the repo's build convention and add tasks.test { useJUnitPlatform() } if it is missing.
Rerun: SUCCESS
Sample Final Report
## Test Generation Report
**Project**: contoso-billing (Kotlin / Gradle)
**Strategy**: Direct (single source file in scope)
### Results
| Metric | Value |
|----------------|-------|
| Tests created | 9 |
| Tests passing | 9 |
| Tests failing | 0 |
| Files created | 1 |
### Files Created
- `src/test/kotlin/com/contoso/billing/InvoiceServiceTest.kt` (9 JUnit 5 invocations: 6 ordinary `@Test` methods and 3 parameterized rows)
### Coverage
- InvoiceService.calculateTotal — 3 happy path, 1 error case
- InvoiceService.getById — found and missing branches
- InvoiceService.markAsPaid — success, already-paid and missing-invoice branches; error cases do not update the repository
### Build / Test Validation
- Compile tests: ✅ `./gradlew compileTestKotlin --console=plain`
- Test run: ✅ `./gradlew test --tests "com.contoso.billing.InvoiceServiceTest" --console=plain`Requirements and compatibility
Written for: Claude Code
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Claude Code frontmatter, Needs Python
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- .NET (Microsoft)
- Publisher
- .NET (Microsoft) (Official)
- Source
- dotnet/skills · plugins/dotnet-test/skills/code-testing-extensions · commit 96c3d68
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by .NET (Microsoft).
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download code-testing-extensions.zip