test-implementation

Enforce FIRST principles and GIVEN/WHEN/THEN structure in C#/.NET tests.

1|Updated May 13, 2026
One-click install
npx skills add https://github.com/Amirault/DevGate --skill test-implementation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-implementation
Source: https://github.com/Amirault/DevGate/tree/main/.agents/skills/test-implementation
Command: npx skills add https://github.com/Amirault/DevGate --skill test-implementation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the inconsistency and fragility often found in test suites by providing a unified, opinionated framework for writing robust, readable, and maintainable C#/.NET tests.

Core Features & Use Cases

  • Standardized Structure: Enforces the GIVEN/WHEN/THEN pattern to ensure tests read like behavioral specifications.
  • Best Practice Enforcement: Provides clear guidelines on FIRST principles, factory methods for setup, and the use of TestContainers for integration testing.
  • Use Case: When implementing a new business use-case, use this skill to ensure your unit tests are fast, isolated, and correctly verify side effects without relying on brittle mock frameworks.

Quick Start

Apply the test-implementation standards to refactor the current test class for the order processing service.

Frequently Asked Questions about test-implementation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize C# .NET testing patterns for better code quality?

Standardize C# .NET testing by enforcing FIRST principles and GIVEN/WHEN/THEN structural requirements. This framework applies factory-based setup and TestContainers for infrastructure, ensuring tests function as readable behavioral specifications across unit and integration scenarios.

What is the GIVEN/WHEN/THEN structure for C# test specifications?

The GIVEN/WHEN/THEN structure is a behavioral specification pattern enforced for C# testing. GIVEN defines the initial state, WHEN triggers the use-case action, and THEN verifies side effects, ensuring tests remain readable, maintainable, and isolated from brittle mock frameworks.

How do I write integration tests for .NET without brittle mock frameworks?

Write .NET integration tests using TestContainers for infrastructure verification instead of brittle mock frameworks. This approach validates secondary adapters and use-case side effects against real dependencies, ensuring robust integration test coverage for finite inputs.

Does TestContainers work with C# unit testing for use-case validation?

TestContainers works with C# testing by providing infrastructure for integration scenarios and secondary adapter verification. While unit tests use factory-based setup for fast isolation, TestContainers handles infrastructure dependencies, ensuring exhaustive coverage for finite inputs.

What's the best way to enforce FIRST principles in dotnet test suites?

Enforce FIRST principles in dotnet test suites by adopting an opinionated framework that mandates fast, isolated, repeatable, self-validating, and timely tests. It achieves this by requiring factory-based setup and exhaustive coverage for finite inputs.

When should I use factory-based setup in C# testing?

Use factory-based setup in C# testing whenever implementing a new business use-case to ensure tests are fast and isolated. This approach replaces brittle mock frameworks, providing maintainable test construction while adhering to FIRST principles.